PDA

View Full Version : Disable initial grouping in grid



bmcelhany
7 Dec 2011, 1:30 PM
Hello,

I have a GridPanel which uses a GroupingStore and a GroupingView. At this point everything is working fine and, when the grid initially loads, the data is grouped by the column specified in my GroupingStore config:


var store = new Ext.data.GroupingStore({
...
groupField: 'appId',
...
});

Now the users would like the initial grouping turned off (but still have the ability to group on any field via the column headers like they currently do). By simply commenting out the above line, all initial grouping is turned off just as expected, however the "Show in groups" checkbox (accessed via the column headers) is still checked when the page loads. They can obviously just un-check and then re-check if they want to manually group, but that's not ideal.

Is there some other configuration change that I need to make (at the GroupingStore, GroupingView or Grid levels) in order to eliminate the initial grouping AND have the "Show in groups" checkbox unchecked when the app first loads? Can't seem to find anything that works...

Thanks in advance!

tobiu
7 Dec 2011, 2:19 PM
in my (quite old) fieldmanager app i used:



var customerStore = new Ext.data.GroupingStore({
url : 'ajaxHandler/ajaxHandler.php'
,reader : reader
,sortInfo : sortInfo
,remoteGroup : true
,remoteSort : true
,baseParams : {
module : 'customerGrid'
,limit : gridRows
,mode : mode
}
,listeners : bT.addHashListeners()
});


and this worked fine -> starting ungrouped, but allowing to check a group field later on.

bmcelhany
7 Dec 2011, 3:05 PM
Thanks for your quick reply Tobias!

Do you happen to know if, in the app you mentioned, the "Show in Groups" check box was checked when the page first loaded? That's really the issue I'm running into: the data is loading and being displayed correctly (i.e. not grouped), however when you click on the drop-down arrow in a column header, the "Show in Groups" check box is still checked (even though nothing is grouped).

It's not so much a functionality issue as much as it's an issue with the UI not accurately reflecting what the user is seeing. In this case, the user is seeing a data grid with no grouping, however the check box is indicating that the data IS grouped. I guess I really just need a way to clear out that check box when the page is first loaded. My hope, though, was that by not telling the GroupingStore to group on anything, the check box would see that and not be checked by default.