In one of my projects I need to load the Json store with a JSOn server response as follows. In the JSon response i am getting 2-3 root elements. but in the store configuration i can only provide 1 root element.
{
{"level2List":[{id:'id1', name:'sample'},....]},
{"level3List":[{id:'id1', name:'sample'},....]},
{"level4List":[{id:'id1', name:'sample'},....]}
}
my store config is like 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 the 1 root element(for ex. level3List) it is loading the respective items properly. But I need the solution to load data from multiple root elements. Please help me in loading the data to the store.