I tried to create base controller and write in it:
Ext.define('My.Users.controller.Role', {
extend : 'Ext.app.Controller',
stores : [
'Modules', 'ModulesList'
],
models : [
'Modules', 'ModulesList'
]
});
But when I tried to use getters for them (in this base class, or in it's child classes, like My.Users.controller.Group), like getModulesStore(), or getModulesListModel(), I have an error that them are not functions. And in Firebug I can see there aren't this methods in child class and in it superclass. How can I to fix it?
The full description how to reproduce this bug: 1) Download ExtJS 4.1 GPL from Sencha
2) Unzip the archive, and go to directory extjs-4.1.0/examples/app/feed-viewer/
3) In file feed-viewer.html comment line <script type="text/javascript" src="all-classes.js"></script> to force dynamic loading of js files: now you can normally edit the content of project files.
4) In folder app/controller create file named Entities.js with following code:
Ext.define('FV.controller.Entities', {
extend: 'Ext.app.Controller',
models: ['Shared'],
stores: ['Shared']
});
5) In files Articles.js and Feeds.js change extend to 'FV.controller.Entities'
6) In folders app/model and app/store create files Shared.js with content
Ext.define('FV.model.Shared', {
extend: 'Ext.data.Model',
idProperty: 'id',
fields: [
{
name: 'id',
type: 'int'
},
{
name: 'title',
type: 'string'
}
]
});
for Model and
Ext.define('FV.store.Shared', {
extend: 'Ext.data.Store',
model: 'FV.model.Shared',
proxy: {
type: 'ajax',
url: 'test.json',
reader: {
type: 'json',
root: 'item'
}
}
});
for Store.
7) Finally, for example, in init method of Article.js try to console.log(this); In Firebug you will not get getSharedModel() and getSharedStore() methods.
I've uploaded my sample to http://nekaka.com/d/W1_EOlnPST