team,
I’m having a jsonstore to load my list. I’m loading store using inline data without any proxy config. I wanted to call load event of my store. Kindly let me know how to do it.
Below is my store code:
Store = new Ext.data.JsonStore({
model : ‘SettingModel’,
getGroupString:function(){
return 'Set Duration';
},
autoLoad:false,
data: [
{name: '5 mins', value: '5'},
{name: '15 mins', value: '15'},
{name: '25 mins', value: '25'},
{name: '45 mins', value: '45'}
],
listeners : {
'load': function(){
Ext.Msg.alert('App',"load");
}
}});
Store.load();
with the above code i get the following error message : “Uncaught Error: You are using a ServerProxy but have not supplied it with a url”
if i remove the “Store.load();” line, im not getting error and list is populating with data. But the load event is not fired.
Kindly help me how to make load event to fire in this scenario.
Thanks in Advance
The load event is not called when data is inline. Also, the load method should only be called when data has to be accessed using an AJAX request (that’s why an url for a proxy is needed when you call the .load() method).
Try using the loadData method to load inline data, instead of passing it in the object constructor and the datachanged event if you want to listen each time loadData is called.