My question is how to get metadata other than totalRecords, in my case it is version, code, searchquery (look at json).
{ "result": { "version":"1", "code":"200", "searchquery": "false", "totalRecords": "2", "account":[ { "lastname": "Ivanoff", "firstname": "Ivan", "accountId":"1" }, { "lastname": "Smirnoff", "firstname": "Ivan", "accountId":"2" } ] }
}
Here is my model:
Ext.define("test.Account", { extend: "Ext.data.Model", fields: [ {name: 'accountId', type: 'string'}, {name: 'lastname', type: 'string'}, {name: 'firstname', type: 'string'} ] });
And save:
Ext.define("test.TestStore", { extend: "Ext.data.Store", model: "test.Account", proxy: { type: "ajax", url: "users.json", reader: { type : 'json', root : 'result.account', totalProperty: "result.totalRecords" } }, listeners: { load: function(store, records, success) { console.log("Load: success " + success); } } });
Using this store, I can download records (account) and cannot find any methods for accessing the rest of the fields.
Thanks in advance.
json proxy extjs extjs4 model
barmaleikin
source share