admin管理员组文章数量:1356709
I have tabpanel and 2 items inside. I need dynamically hide or show tabs and select only one of items if hide.
Code example
{
xtype : 'tabpanel',
items: [
{
xtype: 'container',
title : 'Group Info'
},
{
xtype: 'container',
title : 'Product Info'
},
]
}
So in some cases I have to hide tabs and show only product info container...
I have tabpanel and 2 items inside. I need dynamically hide or show tabs and select only one of items if hide.
Code example
{
xtype : 'tabpanel',
items: [
{
xtype: 'container',
title : 'Group Info'
},
{
xtype: 'container',
title : 'Product Info'
},
]
}
So in some cases I have to hide tabs and show only product info container...
Share Improve this question edited Sep 3, 2014 at 14:33 Oleg Patrushev asked Sep 3, 2014 at 14:21 Oleg PatrushevOleg Patrushev 2653 silver badges16 bronze badges 1- What version of Ext? Can you post your code?Did you search for similar questions? stackoverflow./questions/16494264/… – pherris Commented Sep 3, 2014 at 14:24
2 Answers
Reset to default 4so the answer is
var tabPanel = Ext.ComponentQuery.query('#myTabPanel');
tabPanel = tabPanel[0];
tabPanel.getTabBar().hide();
Just get a reference to the tab and use method hide http://docs.sencha./touch/2.3.1/#!/api/Ext.tab.Panel-method-hide
//function in a controller
hideTab : function(){
var tab = Ext.ComponentQuery.query('tab[title='Group Info]')[0];
tab.hide()
}
本文标签: javascriptHow to dynamically hide and show tabs in tabpanelStack Overflow
版权声明:本文标题:javascript - How to dynamically hide and show tabs in tabpanel - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744044818a2581329.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论