The docs for initConfig are quite confusing. When I look at the code below, it looks like I'm overriding constructor, but instead of doing this.callParent, I'm calling initConfig.
I'm trying to see what is creating a store in my app. There is no explicit creation of the store, yet I see the proxy making a request for data. I'm trying to figure out how this is happening. I was going to attack the problem by overriding initComponent, but DBStores are evidently not components. They have this initConfig, but the docs for initConfig raise more questions than they answer.
http://docs.sencha.com/extjs/4.2.2/#...hod-initConfig
Code:
Ext.define('My.awesome.Class', {
// The default config
config: {
name: 'Awesome',
isAwesome: true
},
constructor: function(config) {
this.initConfig(config);
}
});
var awesome = new My.awesome.Class({
name: 'Super Awesome'
});
alert(awesome.getName()); // 'Super Awesome'
Looks to me like the docs are flawed. By throwing in a debugger; statement, it looks like you need to change the constructor call to at least be
Code:
constructor: function(config) {
return this.initConfig(config);
}
since the default constructor is
Code:
constructor: function(config) {
return this;
}
and without it
Code:
x = Ext.create(....)
would not assign anything.
Also seems that if you follow the docs, the object is not correctly constructed. In the case of a store, the store is NOT added to the StoreManager.