PDA

View Full Version : Help in Desktop Example



nitesh35103
24 Jun 2009, 6:10 AM
Hi,

Can someone help me in Desktop Example. My problem is:
I have got a login page in Desktop Example
MyDesktop.LoginWindow = Ext.extend(Ext.app.Module, {
id: 'login-win',
init : function(){
this.launcher = {
text: 'Login',
iconCls:'tabs',
handler : this.createWindow,
scope: this,
windowId:windowIndex
}
},

createWindow : function(src){
var desktop = this.app.getDesktop();
var form = new Ext.FormPanel({
bodyStyle:'padding:5px',
url: 'form-login.php',
items:[{
xtype:'textfield',fieldLabel: 'Login Name',name: 'login',anchor:'95%'
},{
xtype:'textfield',fieldLabel: 'Password',name: 'password',anchor:'95%', inputType:'password'
}],
buttons: [{text: 'Login'
},{text: 'Canel',handler:function(){form.form.reset();}

},{text:'New User'}
]
});
var win = desktop.getWindow('login-win');
if(!win){
win = desktop.createWindow({
id: 'login-win',
title:'Login',
width:400,
height:200,
items:form
});
}

win.show();
}
});
On clicking the button New User, I want to open MyDesktop.FormWindow(), which is
MyDesktop.FormWindow = Ext.extend(Ext.app.Module, {
id:'form-win',
Can someone guide me, how I can open this??