PDA

View Full Version : Gropuing store reading metadata with jsonreader



bramsreddy
11 Nov 2013, 12:58 AM
Hi,

I have a jsonstore with all metadata defined come as apart of store result data like below


"success": true, "metaData": { "fields": [.....]

Now i want to use grouping store with jsonreader to read this metadata to group the records in the grid.

I replced json store with grouping store and added a grouping view to grid.

But I am getting error 'this.fields.get is not a function...'. I think this is because grouping store can't read the fields inside store result.

How can i fix this ?


store = new Ext.data.GroupingStore({
url : 'getData.htm',
root : 'Data',
remoteSort : true,
sortInfo : {field:'ID', direction:'ASC'},
totalProperty : 'totalCount',
reader : new Ext.data.JsonReader(),
fields : new Ext.data.Record.create([]),
autoLoad : false,
stateful : true,
stateEvents : ['reload'],
groupField : 'OrgID'
});

slemmon
20 Nov 2013, 10:24 AM
Any chance you could post a full test case including a data snippet like what you're server would return?

You can use https://fiddle.sencha.com (log in with forum username/password) to create/share the test case if that's helpful.