Hybrid View
-
28 Feb 2008 7:23 PM #1
about collapse TabPanel
about collapse TabPanel
as below,I set "collapsible:true, titleCollapse:true".
when I cilick on tabs,the panel will collapse too,I want to collapse panel only when I click title of tabpanel,how to config?thanks
var tabs = new Ext.TabPanel({
collapsible:true,
titleCollapse:true,
renderTo:'tabs',
resizeTabs:true, // turn on tab resizing
minTabWidth: 115,
tabWidth:135,
enableTabScroll:true,
autoWidth:true,
height:250,
defaults: {autoScroll:true},
activeTab: 0,
items: [{
title: 'Tab 1',
html: 'A simple tab'
},{
title: 'Tab 2',
html: 'Another one'
}]
});
-
28 Feb 2008 8:19 PM #2
Take a look at the 'activate' event on the panel. You should be able to listen for this event then call the 'collapse' function on the panel.
-
28 Feb 2008 10:21 PM #3
-
12 Sep 2012 12:00 AM #4
just have the same problem, and below is my solution
Code:xtype: 'tabpanel', titleCollapse: true, animate: true, items: [{ title: 'tab1', xtype: 'panel' }, { title: 'tab2', xtype: 'panel' }], listeners: { afterrender: function() { var me = this; me.mun(me.header, 'click', me.toggleCollapse, me); me.mon(me.header, 'click', function(e, el, opt) { if(Ext.get(el).hasClass('x-tab-strip')) me.toggleCollapse(me.animate); }, me); } }Phi Tien


Reply With Quote