PDA

View Full Version : Dynamic height for a hBox layout container



naguws2004
25 Sep 2012, 3:23 AM
Hi,

I have 2 containers of hBox layouts one after the other with some controls. I have specified heights to the containers so everything renders fine. But when I hide some controls in the first container, I would like to dynamically resize the first container. I tried removing height but it doesn't display the container at all. Flex is not an option. How to dynamically resize the hBoxes when rendering.

Code:
items: [
{
xtype: 'container',
height: 296,
layout: {
align: 'stretch',
type: 'hbox'
},
items: [
{
xtype: 'container',
width: 957,
layout: 'vbox',
padding: '0 0 0 0',
style:'background-color:Transparent;',
items: [
textBox1, textBox2, label1, textBox3, textBox4, button1, label2, label3, checkBox1, checkBox2
]
}
]
},
{
xtype: 'container',
height: 196,
layout: {
align: 'stretch',
type: 'hbox'
},
items: [
{
xtype: 'container',
width: 956.5,
layout: 'vbox',
padding: '0 0 0 0',
style:'background-color:rgb(255, 0, 0);',
items: [
button2, button3, textBox5, textBox6, button4, button5
]
}
]
}
]

Thanks in advance

mitchellsimoens
27 Sep 2012, 8:04 AM
In 4.1.x you can use auto heighting for box layouts but it's not optimal because of the measurements it has to do.