Reputation: 2480
I have a grid panel and i want to get data that i embed in store
My json look like (embed
is my embed data)
({"total":"20","results":[{...}], "embed": [{...}] })
How to get embed
data in my load
function. Thanks
var store = Ext.create('Ext.data.Store', {
model: 'MyDataObject',
autoLoad: true,
pageSize:10,
proxy: {
type: 'ajax',
url: 'data.php',
reader: {
type: 'json',
totalProperty: 'total', // total data
root: 'results'
}
}
,listeners: {
load: function( store, records, successful, eOpts ){
if (successful) {
alert(store.embed) // ?? how to get it
}
}
}
});
Upvotes: 1
Views: 899
Reputation: 30092
The proxy keeps a reference to the rawData
property for the most recent load.
console.log(store.getProxy().getReader().rawData.embed);
Upvotes: 2