PDA

View Full Version : On render Ext.window



osmancorp
12 Sep 2010, 9:34 AM
Hello ,


How can I view a Ext.window only when it is fully loaded because currently I instantiate a window at startup of my gui but it appears little by little

I instantiate my window with this :


Opp.Login = new Window.Login();
Opp.Login.show();


My Window :



Window.Login = Ext.extend(Ext.Window, {
constructor: function(config){

var loginForm = new Ext.form.FormPanel({
bodyStyle: 'padding:8px;background:transparent;'
,border : false
,autoDestroy : true
,id : 'login-form'
,stateful: true
,items: [ Window.Combo,
{ xtype: 'textfield', id: 'password',msgTarget:'side',fieldLabel: 'Password',allowBlank:false,width : 200,inputType: 'password'}],
buttons: [{text: 'Login',handler: function() { Call.init('Login'); } },
]
,keys: [
{ key: [Ext.EventObject.ENTER], handler: function() {
Call.init('Login');
}
}
]

});

config = Ext.apply({


title: 'Authentification IHM',
layout: 'form',
autoDestroy : true,
id:'lock',
bodyStyle: 'padding:15px;background:transparent;',
width: 390,
Height: 170,
closeAction: 'hide',
modal : true,
border: false,
closable: false,
resizable: false,
draggable: false,
items: [loginForm]




}, config);

Window.Login.superclass.constructor.call(this, config);
}
});



Thanks you


Osmancorp

laurentParis
12 Sep 2010, 10:15 AM
try this solution :

set your form with


hidden: true,...


and add afterShow method for your Window.Login, to show form only after rendered


afterShow: function (isAnim) {
Window.Login.superclass.afterShow.call(this, isAnim);
Ext.getCmp('login-form').show();
}