How to make two AJAX calls for two different stores in ExtJS?
I want two stores for generating two charts in same window. Both get JSON data from the server.
Ext.regModel('chartdata',
{
fields: [{ name: 'x', type: 'string' },
{ name: 'a', type: 'float' },
开发者_开发百科 { name: 'b', type: 'float' },
{ name: 'c', type: 'float' },
{ name: 'd', type: 'int' },
'Year'
]
});
var store = new Ext.data.Store({
model: 'chartdata',
proxy: {
type: 'ajax',
url: 'here is my url'
}
});
Ext.regModel('authTaskWiseData', {
fields: ['state_name', 'state_code', 'Basic_Literacy', 'Continuing_Education', 'Equivalency', 'Training', 'Community_Mobisilation', 'Management']
});
var authStore = new Ext.data.Store({
model: 'authTaskWiseData',
proxy: {
type: 'ajax',
url: 'second url'
}
});
store.load();
authStore.load();
Only the first AJAX call is actually sent, but not the second. What might be the problem?
Trying adding autoload:true to your store declaration if you need them to load immediately.
精彩评论