Affichage des articles dont le libellé est Ext.window override destroy in child class on close button of window in parent class. Afficher tous les articles
Affichage des articles dont le libellé est Ext.window override destroy in child class on close button of window in parent class. Afficher tous les articles

mardi 23 décembre 2014

Ext.window override destroy in child class on close button of window in parent class

I have a ext.window in my code which has the default save and close button. On close button click I am hiding the window:

Code:



Ext.define('MyPack.template.TemplateWindow', {
extend : 'Ext.Window',

id: 'templateEditorWindow',
closeAction: 'hide',
autoScroll: false,


createTemplateEditor : function() {
// some code
},


initComponent : function() {


this.createTemplateEditor();


Ext.applyIf(this, {
layout : 'border',
modal : true
});


this.items = [ this.templateEditor ];
this.buttons = [
{ text : '#{msgs.button_save}',
window : this,
handler : function () {
if(this.window.templateEditor.save()) {
this.window.hide();
}
}
},
{ text : '#{msgs.button_close}',
cls : 'secondaryBtn',
window : this,
handler : function( ){
this.window.hide();
}
}
];


this.callParent(arguments);
},


});

I have one another window which is extending above window.

Code:



Ext.define('MyPack.template.RestfulTemplateWindow', {
extend : 'MyPack.template.TemplateWindow',


createTemplateEditor : function() {
// some code
}
});

I am creating this child class. The window is created properly. But I want to override handler function of close button. On close it should destroy.

How can I override it?






Ext.window override destroy in child class on close button of window in parent class