PDA

View Full Version : Change grouping in grouping view



iceblast_01
16 Feb 2011, 10:52 PM
is it posible to change the groupingfield of a grouping store then refresh the grouping view?

I tried:


var store = new Ext.data.GroupingStore({
reader: new Ext.data.JsonReader({
...
[{name: 'date'},{name:'email'},...]
}),
groupField: 'date' //the store is currently grouped by date
});

var grid = new Ext.grid.GridPanel({
store:store,
view: new Ext.grid.GroupingView({
...
})
});

//this button changes the grouping from date to be grouped by email
button.on('click',function(){
store.groupField='email';
grid.getView().refresh(true);
});