Hey,
Quick example, I have an AbstractView/ViewController, and a bunch of different View/ViewController that all extend that abstractView. Lets say :
Code:
Ext.define('MyApp.view.abstract.AbstractView', {
extend: 'Ext.panel.Panel',
...
});
Ext.define('MyApp.view.abstract.AbstractViewController', {
extend: 'Ext.app.ViewController',
alias: 'controller.abstract',
...
someSharedEvent: function() {
this.fireEvent('sharedEvent','whatever');
}
});
Ext.define('MyApp.view.foo.Foo', {
extend: 'MyApp.view.abstract.AbstractView',
...
});
Ext.define('MyApp.view.foo.FooViewController', {
extend: 'MyApp.view.abstract.AbstractViewController,
alias: 'controller.foo',
...
});
Ext.define('MyApp.view.bar.Bar', {
extend: 'MyApp.view.abstract.AbstractView',
...
});
Ext.define('MyApp.view.bar.BarViewController', {
extend: 'MyApp.view.abstract.AbstractViewController',
alias: 'controller.bar',
...
});
AbstractView/ViewController is there for some shared items/events. I would like to listen to the abstractVC firing but it doesnt seem to work with the alias like this :
Code:
this.listen({
controller: {
'abstract': function() {
//never called.
},
'foo': function() {
//called.
},
'bar': function() {
//called.
}
}
})
Whats the best way to achieve this, I hate duplicating all my listens. thanks!