In one of my projects, I need to download the Json store with the JSOn server response as follows. In JSon's answer, I get 2-3 root elements. but in the store configuration I can provide only one root element.
{
{"level2List":[{id:'id1', name:'sample'},....]},
{"level3List":[{id:'id1', name:'sample'},....]},
{"level4List":[{id:'id1', name:'sample'},....]}
}
My store configuration as below.
store = new Ext.data.JsonStore({
// store configs
storeId: 'myStore',
proxy: {
type: 'ajax',
url: 'xml/getKpiInputData.json',
reader: {
type: 'json',
root: 'level3List',
idProperty: 'name'
}
},
fields: [
{name: 'name'},
{name: 'id'},
...
],
remoteFilter: false,
remoteSort: true,
pageSize: 10,
autoLoad: {start: 0, limit: 10}
});
If I give 1 root element (e.g. level3List), it loads the corresponding elements correctly. But I need a solution to load data from multiple root elements. Please help me in uploading data to the store.
source
share