I have developed a versatile component that is being utilized across different products. In this case, I have a generic window and window controller which I am customizing to fit our specific product requirements.
This is my generic window:
Ext.define('App.win.Panel', {
extend: 'Ext.window.Window',
closeAction:'destroy',
maximizable:true,
hideToolbar:false,
requires: [
'App.MyWinCon.PanelController'
],
xtype: 'MyWin',
name:'MyWin',
controller: 'MyWinCon',
layout: {
type: 'border'
},
gridConfigs:{},
initComponent:function(){
var p=this;
p.items = [{
//items
}];
p.callParent(arguments);
}
});
In our product application, I am utilizing this generic window by overriding it in the following way:
var Window1 = Ext.create('App.win.Panel', {
title: 'Window',
modal:true,
height: '90%',
width: '95%',
parentGridObj:gridObj,
});
Window1.show();
Everything is working fine so far, and the window is displaying as expected. Now, I have also created a generic controller. Here is a snippet of the code:
Ext.define('App.MyWinCon.PanelController', {
extend: 'Ext.app.ViewController',
alias: 'controller.MyWinCon',
init: function(){
var p = this;
p.control({
#:{
beforeclose : function(this){
// Some code
}
}
});
}
Can someone guide me on how to access the 'beforeclose' method or similar methods in my application that are defined in the generic class? Your assistance will be greatly appreciated. Thank you.