Reputation: 15039
I have a store
that uses a custom proxy.
Ext.define('MyApp.proxy.Proxy', {
extend: 'Ext.data.proxy.Ajax',
alias: 'proxy.myproxy',
type: 'ajax',
reader: {
type: 'json',
messageProperty: 'msg',
rootProperty: 'data',
totalProperty: 'num'
}
});
How can I change the store rootProperty on code.
Right now Im using this:
var storeMenu = Ext.create('MyApp.store.menu.Menu');
storeMenu.proxy.reader.setRootProperty('data.items');
Is this the right way to do it?
Upvotes: 1
Views: 2004
Reputation: 2536
rootProperty
can also accept a function where you return the array you want to be parsed into records:
https://fiddle.sencha.com/#fiddle/1bo2
Upvotes: 1