PDA

View Full Version : Making hidden region visible



Anup Rana
12 Nov 2010, 2:13 AM
var upperMenu;
var viewportMenu ;
var treepanel;
Ext.onReady(function() {
Ext.QuickTips.init();
var lowerMenu = new Ext.Toolbar({
items : [{
html : '<center><font color=#15428B >copyright 2010</font></center>'
}, {
xtype : 'tbfill'
}, {
xtype : 'tbbutton',
id : 'RegisterForgot',
hidden : true,
text : '<b><font size=2pt>login</font></b>',
style : 'font-family:Georgia;font-size:10px;color:#ED7014;'
}

]
});
treepanel = new Ext.tree.TreePanel({
region : 'west',
//renderTo: document.body,
frame : true,
collapsible : true,
titleCollapse : true,
//style : 'padding-bottom: 5px',
loader : new Ext.tree.TreeLoader(),
rootVisible : false,
lines : false,
root : new Ext.tree.AsyncTreeNode({
id : 'isroot',
expanded : true,
children : [{
id : '1',
text : 'View History',
leaf : false,
collapsible : true,
titleCollapse : true,
children : [{
id : '1',
text : 'View Mapping',
leaf : true
}, {
id : '2',
text : 'View Company',
leaf : true
}

]
}]
})
});

upperMenu = new Ext.Toolbar({
id : 'upperMenu',
border : false,
hidden : true,
renderTo : document.body,
items : [{

xtype : 'tbbutton',
text : '<b><font size=2pt>Upload GL</font></b>',
style : 'font-family:Georgia;font-size:10px;color:#ED7014;',
handler : function() {
mapping_GL.hide();
UserElewindow.hide();
mapping_UEST.hide();
winRegisterCmp.hide();
winRegisterDiv.hide();
winRegisterSubDiv.hide();
winChangePass.hide();
UploadWin.show();

}
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbseparator'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbsplit',
text : '<b><font size=2pt>Company</font></b>',
menu : [{
text : '<b><font color=#15428B size=1pt>Add Company</font></b>',
handler : function() {
mapping_GL.hide();
UserElewindow.hide();
mapping_UEST.hide();
UploadWin.hide();
winRegisterDiv.hide();
winRegisterSubDiv.hide();
winChangePass.hide();
winRegisterCmp.show();
}
}, {
text : '<b><font color=#15428B size=1pt>Add Division</font></b>',
handler : function() {
mapping_GL.hide();
UserElewindow.hide();
mapping_UEST.hide();
UploadWin.hide();
winRegisterCmp.hide();
winRegisterSubDiv.hide();
winChangePass.hide();
winRegisterDiv.show();
cinNo.load();
}
}, {
text : '<b><font color=#15428B size=1pt>Add SubDivision</font></b>',
handler : function() {
mapping_GL.hide();
UserElewindow.hide();
mapping_UEST.hide();
UploadWin.hide();
winRegisterCmp.hide();
winRegisterDiv.hide();
winChangePass.hide();
winRegisterSubDiv.show();
cinnos.load();
divname.load();

}
}

]
}, {
xtype : 'tbfill'
}, {
xtype : 'tbsplit',
text : '<b><font size=2pt>User</font></b>',
menu : [{
text : '<b><font color=#15428B size=1pt>Edit Profile</font></b>',
handler : function() {
mapping_GL.hide();
UserElewindow.hide();
mapping_UEST.hide();
UploadWin.hide();
winRegisterCmp.hide();
winRegisterSubDiv.hide();
winRegisterDiv.hide();
// winChangePass.show();
}

}, {
text : '<b><font color=#15428B size=1pt>Change Password</font></b>',
handler : function() {
mapping_GL.hide();
UserElewindow.hide();
mapping_UEST.hide();
UploadWin.hide();
winRegisterCmp.hide();
winRegisterSubDiv.hide();
winRegisterDiv.hide();
winChangePass.show();
}
}, {
text : '<b><font color=#15428B size=1pt>Add User</font></b>'
}

]
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbseparator'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbspacer'
}, {
xtype : 'tbspacer'
}, {

xtype : 'tbbutton',
text : '<b><font size=2pt color="red">Logout</font></b>',
style : 'font-family:Georgia;font-size:10px;color:#ED7014;',
autoheight : true,
handler : function() {
// login_form.getForm().reset();
mapping_GL.hide();
UserElewindow.hide();
mapping_UEST.hide();
UploadWin.hide();
winRegisterCmp.hide();
winRegisterSubDiv.hide();
winRegisterDiv.hide();
winChangePass.hide();
UploadWin.hide();
Uploadform.hide();
winLogin.show();
//Ext.getCmp('west-zone').hide();
Ext.getCmp('upperMenu').hide();
}
}

]

});
viewportMenu = new Ext.Viewport({
layout : 'border',
id : 'viewMenu',
renderTo: Ext.getBody(),
items : [{
id : 'north-zone',
region : 'north',
layout : 'fit',
autoHeight : true,
// split:true,
title : '<b><font size=2pt>IRIS iAXE</font></b>',
height : 20,
border : false,
items : [upperMenu]

}, {

id : 'west-zone',
//renderTo: document.body,
region : 'west',
//visibility: true,
hidden:true,
layout : 'fit',
border:false,
//bodyStyle:'padding:5px;',
margins:'30 0 0 1',
cmargins: '0 0 0 1',
//margins: '0 0 0 5',
// y:'40px',
// x:30,
split : true,
//autoHeight :true,
title : '<b><font size=2pt>History</font></b>',
width : 135,
height : 30,
collapsible :true,
items : [treepanel]
},

{
id : 'south-zone',
region : 'south',
layout : 'fit',
title : '<center><font color=#15428B >copyright 2010</font></center>',
// xtype:'toolbar',
// split:true,
// style:'font-family:Georgia;font-size:10px;color:#ED7014;',
height : 30
// items:[lowerMenu]
},
{
id : 'center-zone',
region : 'center',
xtype : 'panel',
layout:'fit',
margins: '30 30 0 30',
items : [{
contentEl : 'login_form'

}
]

}

]
});

});

I am trying to hide the west region and toolbar in the north region at the time of login and making it visible on the home page when user has logged in but the west region is not coming at the right position when i m making it visible at home page .