Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Nested grid disappears when collapsing list grid record

    SmartGWT 3.0
    v8.2p_2012-10-11/PowerEdition Deployment
    IE 8
    Google Chrome 27.0.1453.94

    Hi Isomorphic,

    I am facing an issue around Nested Grids.

    If I expand more than one record to display nested grids (expanded.JPG) and then try to collapse a single record all nested list grids disappear (collapsed.JPG).

    I am able to reproduce this in your showcase example http://www.smartclient.com/smartgwt/...ed_nested_grid if I remove the primary key from the datasource field in SupplyCategoryXmlDS.java:
    Code:
    DataSourceTextField itemNameField = new DataSourceTextField("categoryName", "Item", 128, true);  
    //itemNameField.setPrimaryKey(true);
    When I set itemNameField as a primary key the collapse functionality works as I expect.

    However when I fetch the data and use a DSCallback() which I use to set data to the listGrid from the response:
    Code:
    listGrid.fetchData(null, new DSCallback() {
    				
    				@Override
    				public void execute(DSResponse response, Object rawData, DSRequest request) 
                                    {
    	                	listGrid.setData(response.getData());
    				}
    			});
    the same collapsing issue occurs.

    - Is a primary key needed for collapsing a nested listGrid?
    - Would using a DSCallback and setting the List Grid data from the response cause the the DataSourceTextField to lose is primary key?

    Any help would be appreciated?

    Thanks
    Todd
    Attached Files
    Last edited by todd.savage; 13 Nov 2014, 08:49.

    #2
    - Is a primary key needed for collapsing a nested listGrid?
    Yes. It's used to uniquely associate records with their expansion components.

    - Would using a DSCallback and setting the List Grid data from the response cause the the DataSourceTextField to lose is primary key?
    We don't really follow this question, but what would actually create the described issue is not providing the grid with a DataSource at all.

    Comment


      #3
      Two updates here:

      1. current versions do not require a PK to work. You should update to the latest before doing any new development, as 3.0 is no longer receiving fixes and does not support the latest browsers.

      2. setData() would indeed clear out all expansion components, by design. That API indicates that you are providing an entirely new dataset with potentially no records in common with the current dataset, so there's no reason to expect that existing expansions should be maintained.

      Comment


        #4
        Thanks for the further update. After trying the same code on the trial version of SmartGWT 5 I can see the issue no longer exists.

        Comment

        Working...
        X