Thanks so much mag_42...this helped me a lot.
My use case appears to be a little different.
I have remoteSort = true, remoteGroup = false.
So I changed the logic in GroupingStore:groupBy a little...
Code:
Ext.override(Ext.data.GroupingStore, {
clearGrouping : function(noreload){
this.groupField = false;
if(this.remoteGroup){
...
...
...
if (!noreload) { // <<< FIX: Stop the forced reload
this.reload();
}
}else{
if (!noreload) { // <<< FIX: Stop the forced reload
this.sort();
this.fireEvent('datachanged', this);
}
}
},
groupBy : function(field, forceRegroup, direction, noreload){
...
...
...
if (!noreload) {
if (this.remoteGroup) {
this.on('load', fireGroupEvent, this, {single: true});
this.reload();
} else {
this.sort(sorters); // Note that this call results in a load of the store if remoteSort=true
fireGroupEvent.call(this);
}
...
...
...
}
})
The main problem being that both reload and sort can result in a call to the server.
We should probably entry a bug on this...because the state persistence is not working consistently for all persisted grid attributes.
The Grouping feature is awesome and a big selling point - its unacceptable to have these patches floating around from Ext JS release to release - that's a lot of baggage and patching that has to be maintained.
Really appreciated your help on this.