View Full Version : get simple store

4 Apr 2011, 4:58 AM
i have a simple json data in javascript code
and i want get a simple jsonStore like this
store = new Ext.data.JsonStore({ data: curData});
but this line has error
when i set idProprety and fields that line correctly work
please help me
i don't want set idProperty and fields

4 Apr 2011, 5:28 AM
If you don't define fields how do you expect it to work?

4 Apr 2011, 5:30 AM
JsonStore is an extension of Ext.data.Store, and has more requirements than Ext.data.SimpleStore.

Perhaps, if you are wanting your store to be a little more dynamic, you need to send meta data to the Reader object (see Automatic configuration using metaData @ http://dev.sencha.com/deploy/dev/docs/source/JsonReader.html#cls-Ext.data.JsonReader)

4 Apr 2011, 8:11 AM
Basically you need to have an additional parameter on their which will act as the translator for the store. Defining each field that is contained in the json data


field: [{name: 'test', dataIndex: 'test'}, {name: 'test2', dataIndex: 'test2'}],