I’ve read many posts about this but still settimeout doesn’t work. I suspect it’s because of the “this” in the code, and probably because of local/global variable scope. How can I set correctly settimeout to close after 3 seconds the ext.window?, thanks, pls help
action = new Ext.Action({
handler: function(){
if (this.pressed){
if (!this.panelWin){
this.panelWin = new Ext.Window({
border: false,
resizable: false,
draggable: false,
closable: false,
layout: 'fit',
autoWidth: true,
autoHeight: true,
items: [newPanel],
listeners:{
show: function() {
setTimeout("this.panelWin.destroy()", 3000);
}
}
});
}
this.panelWin.show();
}
else
{
this.panelWin.hide();
}
}
});
Try this: