PDA

View Full Version : beforedestroy and clearMons



Gabor Turi
16 Jan 2011, 10:57 PM
Hi, is beforedestroy public event?

I wanted to use:

Ext.onReady(function () {
var panel = new Ext.Panel({
renderTo: Ext.getBody(),
width: 200,
height: 200,
tools: [{
id: 'close',
handler: function (e, dom, panel) {
panel.destroy();
}
}]
});

panel.on('beforedestroy', function () {
alert('You can not delete...');
return false;
});
}); But, Ext.Component.prototype.purgeListeners:

this.on('beforedestroy', this.clearMons, this, {single: true});This command "unmake" the panel's events!

Can I use this event?

Gabor

Condor
17 Jan 2011, 12:40 AM
IMHO 'mon' should be using the beforeDestroy method instead of the 'beforedestroy' event.

Moving to bugs.