Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

ListGrid: grouping not updated on group field value changed by ListGrid.updateData()

$
0
0
I've noticed that when a grouped ListGrid gets some changes on the group field values, eventually as a response for ListGrid.updateData(), those changes are not reflected into the grouping. In other words the updated records are not moved from the previous group to the new one.
I've originally reproduced it using a dated SmartGWT 4.0p nightly build (SmartClient Version: v9.0p_2014-01-05/LGPL Development Only (built 2014-01-05)) but also on the actual SmartClient showcase.

STEPS TO REPRODUCE in SmartClient showcase

1. replace dynamicGrouping.js tab contents at Dynamic Grouping example with the following contents
2. select a record in the grid
3. click on the Move selected country to Mu Continent button

you should see how the selected record Continent field changes to Mu, but it remains in the old group

Code:

var grid = isc.ListGrid.create({
    ID: "countryList",
    width:522, height:224,
    alternateRecordStyles:true, cellHeight:22,
    dataSource: countryDS,
    // display a subset of fields from the datasource
    fields:[
        {name:"countryName"},
        {name:"government"},
        {name:"continent"},
        {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false}
    ],
    groupStartOpen:"all",
    groupByField: 'continent',
    autoFetchData: true
})

isc.Button.create ({
  top: 250,
  left: 100,
  width: 200,
  title:'Move selected contry to Mu Continent',
  click: function() {
    var record = grid.getSelectedRecord ();
    record.continent = 'Mu';
    grid.updateData (record);
  }
})

Follows a screenshot showing the United states record with Continent set to Mu, but still in the North America group.


Attached Images
File Type: png grouping.png (65.6 KB)

Viewing all articles
Browse latest Browse all 4756

Trending Articles