PDA

View Full Version : [2.0b1] TabPanel malformed display when no items added.



Animal
23 Oct 2007, 5:25 AM
To reproduce, comment out the adding of the tabs in the tabs-adv.js file in examples/tabs like so:



Ext.onReady(function(){

var tabs = new Ext.TabPanel({
renderTo:'tabs',
resizeTabs:true, // turn on tab resizing
minTabWidth: 115,
tabWidth:135,
enableTabScroll:true,
width:600,
height:250,
defaults: {autoScroll:true},
plugins: new Ext.ux.TabCloseMenu()
});

// tab generation code
var index = 0;
/*
while(index < 7){
addTab();
}
*/
function addTab(){
tabs.add({
title: 'New Tab ' + (++index),
iconCls: 'tabs',
html: 'Tab Body ' + (index) + '<br/><br/>'
+ Ext.example.bogusMarkup,
closable:true
}).show();
}

new Ext.Button({
text: 'Add Tab',
handler: addTab,
iconCls:'new-tab'
}).render(document.body, 'tabs');
});

Animal
23 Oct 2007, 5:55 AM
Thanks for moving the thread! I'm a bit distracted right now!

cybershield
1 Nov 2007, 12:19 AM
If a your problem is a resizing of tabpanel after insert a first tab, i a found a fix:



function addTab(){
var size = tabs.getSize(); // FIX: get last size of tabpanel
tabs.add({
title: 'New Tab ' + (++index),
iconCls: 'tabs',
html: 'Tab Body ' + (index) + '<br/><br/>'
+ Ext.example.bogusMarkup,
closable:true
}).show();
tabs.lastSize = null; // FIX: important or setSize don't work
tabs.setSize(size); // FIX: resize of prev height of tabpanel
}


Ciao