I am looking for a proper way to implement communication between my views and their respective controllers.
- Calling controller method from its view?
- Getting reference to its view inside controller?
So for now, I am calling controller's method in my view like this:
Ext.define('SomeApp.view.SomeTab', {
extend: 'Ext.grid.Panel',
alias: 'widget.someTab',
initComponent: function() {
// Calling respective controller method to run the initializing sequence
PfalzkomApp.app.getController('someTabController').initializeSomeTab();
this.callParent();
}, ....
And to access my view inside my controller, I followed this solution
Ext.define('SomeApp.controller.SomeTabController', {
extend: 'Ext.app.Controller',
views: [
'SomeTab'
],
refs: [{
ref: 'SomeTab',//xtype
}],...
But I am only able to access my view after it is rendered which makes sense but I was wondering if there is a better solution.
Thank you.