PDA

View Full Version : tabl panel hide



Guru__singh
25 May 2012, 3:16 AM
Hello Guys,

i have a issue, and after searching a lot on forms i am writing here.

simple question is how to hide the tabl panel..when i execute Ext.getCmp('myTabPanel').hide(); its not working.. below is the code



Ext.define('gdoc.view.ui.MyTabPanel', {
extend: 'Ext.tab.Panel',
id: 'tbPanel',
closeAction: 'hide',
activeTab: 0,
plain: true,
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'panel',
id: 'tbForecast',
padding: 5,
closable: true,
closeAction: 'hide',
title: 'lorem'
},
{
xtype: 'panel',
autoRender: true,
id: 'tbDocument',
padding: 5,
closable: true,
closeAction: 'hide',
collapsible: true,
title: 'Document'
}
]
});

me.callParent(arguments);
}
});

and here is now i am hiding


Ext.getCmp('tbDocument').hide();


i tried the below as well but its not there in dom hideTabStripItem()

plz advice.. if i am missing something

chramer
25 May 2012, 1:54 PM
If you specified closeAction: 'hide', the close (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel-method-close) method should also work..

P.S.


Ext.getCmp('tbDocument').hide();

tbDocument in your code is a tab.. so you are trying to hide a tab or the tabpanel ?

Guru__singh
27 May 2012, 9:46 PM
Thanks for your reply

i want to hide tabpanel, but it seems to be not working for me..

plz advice

chramer
27 May 2012, 10:04 PM
Have you tried :
Ext.getCmp('tbPanel').hide();

OR

Ext.getCmp('tbPanel').close();

Guru__singh
27 May 2012, 11:29 PM
opps..

i want to hide the tabs...

not the tab panel.

chramer
28 May 2012, 12:54 AM
It seems that there is a problem with the 'hide' method
this doesn't work
Ext.getCmp('tbDocument').hide();

this also doesn't work
Ext.getCmp('tbDocument').close();

But if I comment 'closeAction'


{
xtype: 'panel',
autoRender: true,
id: 'tbDocument',
padding: 5,
closable: true,
//closeAction: 'hide',
collapsible: true,
title: 'Document'
}

Ext.getCmp('tbDocument').close(); - works just fine

Alternatives :
* use the 'disable (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.AbstractComponent-method-disable)' method
* store the tab in a variable, and than just play with add/remove methods of the tabpanel..

Guru__singh
28 May 2012, 1:13 AM
thanks.

i had encounted the same issue, now i am working with disable, but the questions remain the same.. why its not working..