PDA

View Full Version : [Ext 2.0] TabPanel & tabWidth does not work as long as I did not use width



kubens
22 Jul 2007, 5:11 AM
I am not sure if this is a bug. I am working with Ext2.0 revision 769 and I have a strange behaviour pointed out with tab panels. If I assign tabWidth to a tab panel then this attribute is only considered if I have assigned a the width attribute to the tab panel too.



// tabWidth does not work
tab1 = new Ext.TabPanel ({
renderTo:document.body,
activeTab:0,
defaults:{autoScroll: true, autoHeight: true, autoWidth: true},
resizeTabs:true,
minTabWidth:100,
tabWidth:150,
items:[
{title:"Tab 1",autoLoad:"ajax1.htm"},
{title:"Tab 2",autoLoad:"ajax2.htm"},
{title:"Tab 3",html:"html tab3",closable:true},
{title:"Tab 4",html:"html tab4",closable:true}
]
});

// tabWidth works
tab2 = new Ext.TabPanel ({
renderTo:document.body,
activeTab:0,
defaults:{autoScroll: true, autoHeight: true, autoWidth: true},
resizeTabs:true,
minTabWidth:100,
tabWidth:150,
width:900,
items:[
{title:"Tab 1",autoLoad:"ajax1.htm"},
{title:"Tab 2",autoLoad:"ajax2.htm"},
{title:"Tab 3",html:"html tab3",closable:true},
{title:"Tab 4",html:"html tab4",closable:true}
]
});


Br
Wolfgang

jack.slocum
23 Jul 2007, 1:26 AM
resizeTabs is triggered by size changes to the TabPanel. If you never supply a size to the TabPanel, then it will never get triggered. There is no way to resizeTabs and have auto width.

If you must have it, you can call autoSizeTabs() manually.