PDA

View Full Version : hiding Toolabar in the North Region



SwetaMishra
24 Nov 2010, 1:59 AM
var upperMenu;
var viewportMenu ;
var treepanel;
Ext.onReady(function() {
Ext.QuickTips.init();
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();
winEditRegister.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();
winEditRegister.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();
winEditRegister.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();
winEditRegister.hide();
winRegisterSubDiv.show();
cinnos.load();
divname.load();

}
}

]
}, {
xtype : 'tbfill'
}, {
xtype : 'tbsplit',
//text : '<b><font size=2pt>User</font></b>',
id:'user_menu',
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.hide();
EditformRegister.getForm().load({ url: 'EditReg.action',method:'POST'});
winEditRegister.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();
winEditRegister.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();
Ext.Ajax.request({
url : 'Login.action?active=logout'
});
mapping_GL.hide();
UserElewindow.hide();
mapping_UEST.hide();
UploadWin.hide();
winRegisterCmp.hide();
winRegisterSubDiv.hide();
winRegisterDiv.hide();
winChangePass.hide();
winEditRegister.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 : 52,
border : false,
items : [upperMenu],
listeners:{

}

},

{
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 using a toolbar in the north region ....I am hiding it at the time of login and want to unhide the toolbar as soon as user login's and comes to the home page.

Condor
24 Nov 2010, 2:07 AM
And what is the problem? Simply call upperMenu.show() or hide().

ps. You are including the toolbar in a container, so it should not render itself (remove renderTo).

SwetaMishra
24 Nov 2010, 2:14 AM
I am having problem with the height of the north region ....How to adjust the height of the north region accordingly as the upperMenu is shown or hidden .

Condor
24 Nov 2010, 2:16 AM
You will have to adjust the height manually, e.g.

Ext.getCmp('south-zone').setHeight(15);
viewportMenu.doLayout();

solovieff13
7 Dec 2010, 9:11 AM
Hi, Condor. Do you know how can I change the size of center region?

Condor
8 Dec 2010, 12:03 AM
The center region just takes up the remaining space, so you can only change the size of the center region by changing the other regions or by changing the outer border layout container size.