PDA

View Full Version : JsonStore fields question



xnewbie
2 Nov 2009, 2:53 PM
I have a jsonstore object that's returning me this:
{"numberofshapes":2,"details":[{"color":"red","shape":"circle"},{"color":"green","shape":"square"}]}
a grid is reading this as its store and details could contain n number of items. when I declare the fields using fields:['numberofrecords', ['color','shape']], the store count is always 0. I think this part ['color','shape'] is incorrect. can anyone help? thanks,

evant
2 Nov 2009, 2:55 PM
var s = new Ext.data.JsonStore({
url: 'foo',
root: 'details',
totalProperty: 'numberofshapes',
fields: ['color', 'shape']
});