TableSheet Multiple Views

Posted by: michael.thrift2 on 20 September 2022, 11:48 pm EST

  • Posted 20 September 2022, 11:48 pm EST

    I’m encountering behavior with the TableSheet View that I think should be considered a bug.

    I may be wrong, but part of the value of the DataManager / TableSheet / View layers is the ability to display different slices of the underlying data by setting the TableSheet’s View using ```

    sheet.setDataView(view)

    
    An underlying collection may have 30 fields, but View1 may only have columns representing 10 of those fields, while View2 may have different columns representing fields that aren't in View1.   
    
    If this is the case, when a new record is added using ```
    sheet.addRow(item)
    ```, it seems only the fields currently represented in the active view are populated with the data from the new record.  If after adding a new row, you switch views, and columns that are bound to fields that wern't in the first view are blank.
    
    Below is a link to reproduce the behavior. 
    
    https://jscodemine.grapecity.com/sample/4vcvrkv9l02K5ff8tOEfRw/ 
    
    [b]Steps to Reproduce[/b]
    
    There are two views.  The only difference is that View1 displays the "State" field, while View2 displays the "City" field.  
    * "
    * "While on the View1, click the "Add" button to add a new record to the bottom of the table.  "
    
    * "Then click over to View2.  You will see that the City value is empty, even though the field and a value was supplied when adding the new record.  "
    
    * "While still on View2 click the "Add" button again.  You will see another record added to the bottom, and you will see the City field populated. "
    
    * "Click back over to View1 and you will see that this time the State field is empty."
    
    "
    
    
    It is also worth nothing that a call to ```
    sheet.submitChanges()
    ``` (in bulk mode) will pass the inserted recrod to the batch callback function, and that record has all the fields, but all the values are undefined for fields not present in the active view when the record is added.
    
    [b]Expected Behavior[/b]
    
    I would expect that adding a record would persist all fields provided to the underlying dataManager table, and it should not matter which view is active at the time.  Using the view.fetch(true) works but only because it re-requests the data from the server.
  • Posted 21 September 2022, 8:25 pm EST

    Hi,

    Thanks for the sample. We are able to observe the issue at our end hence we have escalated this issue to the concerned team for further investigation. We will update you regarding this as soon as we get any information from the team. The internal ID fo the issue will be SJS-14800.

    Regards,

    Avinash

  • Posted 28 September 2022, 3:16 pm EST

    Hi,

    The team informed us that this is the current designer.

    You could add an invisible “City” column in view1 to workaround the case.

    view1 = myTable.addView("myView", [
        //{ value: "Id", width: 50 },
        { value: "FirstName", width: 100 },
        { value: "LastName", width: 100 },
        { value: "Title", width: 150 },
        { value: "HomePhone", width: 120 },
        { value: "Address", width: 160 },
        { value: "State", width: 100 },
        { value: "PostalCode", width: 100 },
        { value: "Region", width: 100 },
        { value: "City", visible:false, width: 100 }
    ]); 
    

    regards,

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels