I have a proxy defined on my Model.
I have a store defined pointing to the Model, no proxy, as I want it to use the one defined on the Model.
store.autoLoad: true ain’t working
I have to explicitly call from my Controller
var store = this.getMyStore();
store.load();
Is this expected behavior?
- isn’t this what autoload is for?
- will it only work when the proxy is defined on the store?
Code:
model/MyThing.js
Ext.define('MyApp.model.MyThing', {
extend: 'Ext.data.Model',
fields: ['id', 'reference'],
proxy:
{
type: 'ajax',
url: 'MyThings'
}
});
store/MyThings.js
Ext.define('MyApp.store.MyThings', {
extend: 'Ext.data.Store',
autoLoad: true,
autoSync: false,
model: 'MyApp.model.MyThing'
});
Actually, this is a bit of a newbie thing. I’ve been a bit of an eager beaver.
I was looking at the store before it had completed loading (as its asynchronous).
Best practice is to subscribe to the load() function’s callback and then do something…