PDA

View Full Version : tabpanel width into a panel with a hbox layout



McCornic
22 Apr 2010, 2:12 AM
Hi,

it seem to have a bug with the tabpanel width into a panel with a hbox layout.

In the following example, i would like the panel 3 take the size of its content like the panel 2.
But if i don't set a width for the tabpanel, the tabpanel will take nearly all the place.
And the panel 1 disappear.


Ext.onReady(function() {

var viewport = new Ext.Viewport({
layout:'fit',
items: [{
xtype: 'panel',
layout:'hbox',
layoutConfig: {
align:'stretch'
},
items:[{
xtype:'panel',
title:'panel 1',
flex:1,
html:'blablabla ...'
},{
xtype:'panel',
title:'panel 2',
items: {
xtype:'form',
items:[{
xtype:'textfield',
fieldLabel:'field 1'
},{
xtype:'textfield',
fieldLabel:'field 2'
}]
}
},{
xtype:'panel',
title:'panel 3',
items:{
xtype:'tabpanel',
activeItem:0,
width:300,
items:[{
xtype:'form',
title:'tab 1',
items:[{
xtype:'textfield',
fieldLabel:'field 1'
},{
xtype:'textfield',
fieldLabel:'field 2'
}]
},{
xtype:'form',
title:'tab 2',
items:[{
xtype:'textfield',
fieldLabel:'field 1'
},{
xtype:'textfield',
fieldLabel:'field 2'
}]
}]
}
}]
}]
});
});