dedoz
27 Jan 2012, 10:04 PM
hi, question is , can i create a window and show/hide many times or i have to create the window everytime i want to show it ? the real window code is large (has many controls) so im trying to avoid creating the window everytime.
i have this example
Ext.define('WindowX', {
extend: 'Ext.window.Window',
title : 'My simple window',
layout: 'fit',
autoShow: false,
modal: true,
height : 100,
width: 100,
});
var myWindow = Ext.create('WindowX');
var button = Ext.create('Ext.Button',
{ text: 'show window',
handler : function(){
myWindow.show();
},
renderTo: Ext.getBody()
});
If i press the button "show window" the windows shows.
Then i press the close window and the window is gone.
And then i press the button "show window" again and i get an error.
Tried with versions 4.07 4.1pr1 4.1beta1 and beta2, so i guess is not a bug? im doing something wrong.
Also if i add a button to the window , and do this.hide(), happens exactly the same as pressing the traditional close window button (X)
i have this example
Ext.define('WindowX', {
extend: 'Ext.window.Window',
title : 'My simple window',
layout: 'fit',
autoShow: false,
modal: true,
height : 100,
width: 100,
});
var myWindow = Ext.create('WindowX');
var button = Ext.create('Ext.Button',
{ text: 'show window',
handler : function(){
myWindow.show();
},
renderTo: Ext.getBody()
});
If i press the button "show window" the windows shows.
Then i press the close window and the window is gone.
And then i press the button "show window" again and i get an error.
Tried with versions 4.07 4.1pr1 4.1beta1 and beta2, so i guess is not a bug? im doing something wrong.
Also if i add a button to the window , and do this.hide(), happens exactly the same as pressing the traditional close window button (X)