PDA

View Full Version : Loading records to JsonStore



Wolfie
26 Oct 2010, 6:27 AM
Hi all,

I have strange probel,

In my developement work I have build up lots of stores but maybe I just have forgoten about something, this is my code :



var store = new Ext.data.JsonStore({
url: App.baseUrl + '/user/get-sys-permissions',
autoLoad: true,
fields : [{name: 'role'},{name: 'crm_role'},{name: 'pbx_role'},{name: 'ivr_role'}],
baseParams : {id: config.id},
listeners : {
load : function(obj){
var a = obj;
}
}
});


From the server I get this response :



{"role":"ADMIN","crm_role":"SADM","pbx_role":"PBXADM","ivr_role":"IVRSV"}


But the problem is that when I am putting brakepoint in onload event the store is empty without any records,

any ideas ?

should I include reader to this store ? or maybe I just should use Ext.Ajax.request ?

Animal
26 Oct 2010, 7:01 AM
The response should be an Array of row objects.

Wolfie
26 Oct 2010, 11:08 PM
Thanks Animal, it helps a lot :)