PDA

View Full Version : How do an action when layout close



lpastor
13 Aug 2009, 8:01 AM
Hello,

I would like to do an action when I close a window layout.

But nothing append when I do that, and I think that I don't use the good event ?


var button = Ext.get('show-btn');

button.on('click', function(button){

//Ext.Msg.alert('Link', 'Link to something interesting.');

Ext.get('show-btn').dom.disabled = true; // Button disabled

var win = new Ext.Window({
title: 'Layout Window',
closable:true,
width:600,
height:350,
//border:false,
plain:true,
layout: 'border',
listener: {beforedestroy: function () {
Ext.get('show-btn').dom.disabled = false; // That don't work !!!!
Ext.Msg.alert('Message', 'Closing.'); // And that too !!!!
//Ext.get('show-btn').dom.enable = true;
}},
items: [nav, tabs]
});

win.show(this);

});

lpastor
13 Aug 2009, 8:22 AM
I find the solution :


var win = new Ext.Window({
title: 'Layout Window',
closable:true,
width:600,
height:350,
//border:false,
plain:true,
layout: 'border',
items: [nav, tabs]
});

win.show(this);

win.on('close', function(){Ext.get('show-btn').dom.disabled = false;});