PDA

View Full Version : Same DataStore for Grid with "normal" and grouping view



piwo
19 Aug 2009, 2:46 PM
Hi,

I'm trying to use the same DataStore for both normal and grouping Grid. Why? Both Grids basically use the same data (with only small differnces), besides DataStore loading time is pretty long and I would love to close it in one httpproxy request.

The problem occurs when I try to assign GroupingStore to the normal Grid. The data displays but still "grouped" (even without defined GroupingView). Naturally that affects Grid sorting functions.

Normal:


new Ext.grid.GridPanel({
ds: currentDataStore,
cm: OverviewOverallColumnModel,
enableColLock:true,
border: false,
view: new Ext.grid.GroupingView({
enableGrouping: false,
}),
selModel: new Ext.grid.RowSelectionModel({singleSelect:false})
})
with Grouping View:


new Ext.grid.GridPanel({
ds: currentDataStore,
cm: OverviewSquadsColumnModel,
enableColLock:true,
border: false,
view: new Ext.grid.GroupingView({
startCollapsed : true,
forceFit: true,
showGroupName: false,
enableNoGroups: false,
enableGroupingMenu: true,
hideGroupedColumn: true,
}),
selModel: new Ext.grid.RowSelectionModel({singleSelect:false})
})

DS:

currentDataStore = new Ext.data.GroupingStore({
id: 'currentDataStore',
proxy: currentDataProxy,

reader: new Ext.data.JsonReader({
root: 'results',
totalProperty: 'total',
id: 'reader2'
},[
{name: 'group', type: 'string', mapping: 'group'},
{name: 'user_id', type: 'string', mapping: 'user_id'},
{name: 'name', type: 'string', mapping: 'name'},
....
....
....
]),
sortInfo:{field: 'name', direction: "ASC"},
groupField: 'group'

});In API Docu I have found GroupingView property "enableGrouping". Setting it to "false" should theoretically solve my problem, but it seems it doesn't work at all (some other posts on this forum confirm that). Is there any way to solve this problem ?