I am defining a method "onClick" in a widget called main, and then i define, in another component (reportsview) the following method to go from it back to the main view :
onMainView: function() {
var reportsViewInstance = Ext.getCmp('reportsview');
if (reportsViewInstance) {
reportsViewInstance.destroy();
}
var mainV2 = Ext.create('widget.main', {
renderTo: Ext.getBody(),
hideMode: 'visibility'
});
mainV2.show();
}
When the above method is called (e.g in the main view) i expect that the onClick method is callable (because it is defined in the controller of the main) but instead i get an error saying : No method named "onClick" on Class.view.ReportController (which is where the reportsview is defined). I tried with the following in the Class.view.ReportController :
requires: [
'Class.view.MainController'
],
The main view is defined as :
Ext.define('Class.view.Main', {
extend: 'Ext.container.Viewport',
alias: 'widget.main',
id: 'mainView',
xtype: 'mainV',
reference: 'mainViewRef',
controller: 'mainController', ...
In the the mainController i have defined the onClick method which is normally callable when the current view is main but in the above code onClick gives the mentioned error.