PDA

View Full Version : hide tab in tabPanel



mnask
7 Jul 2010, 2:39 AM
hi all ,

i have tabPanel with with items



tabP = new Ext.TabPanel({
activeTab: 0,
id: 'customer-detail-tab',
title: fullname +' ( account # '+accNo +' - status:'+ status +')',
items:[customerInfo_MainePanel,cNotes,tickets_MainePanel]
});




and sometimes i need to hide one of those items customerInfo_MainePanel,cNotesand tickets_MainePanel

i have tried hidden : true , but it does not work

so sometimes i need to hide some of those panels
can you help me please

regards

Animal
7 Jul 2010, 2:43 AM
Tabs get hidden anyway when not active. That's what TabPanels do.

You mean you want to hide the tab selector?

http://www.sencha.com/deploy/dev/docs/?class=Ext.TabPanel&member=getTabEl

You will ave to set its visiblityMode to DISPLAY, otherwise, hiding it will leave a toothy gap in the tab selector strip.

Condor
7 Jul 2010, 3:03 AM
You can use the hideTabStripItem() and unhideTabStripItem() methods to hide tabs.

mnask
7 Jul 2010, 3:04 AM
var cNotes = new Ext.grid.GridPanel({
hidden : true ,
store: cNotesRecDs,
id : 'cNotes-id',
columns: [
{header: "Date", width: 160, sortable: true, dataIndex: 'date'},
{header: "Subject", width: 160, sortable: true, dataIndex: 'subject'},
{header: "Note", width: 160, sortable: true, dataIndex: 'text'},
{header: "Note Author", width: 160, sortable: true, dataIndex: 'authName'}
],
stateful : true ,
frame:false,
border:false,
layout:'fit',
viewConfig:{
forceFit:true
},
listeners: {activate: loadCNotes},
stripeRows: true,
loadMask : true ,
autoWidth : true ,
height : 394 ,
title:'Notes'
});


this is my panel , what i have to do exactly please ?
thanks in advance

Condor
7 Jul 2010, 3:06 AM
tabPanel.hideTabStripItem('cNotes-id');
(and possibly setActiveTab to show a different tab)

mnask
7 Jul 2010, 3:20 AM
thanks condor , you always good helper :)