Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs how to set 100% height for vbox panel

Tags:

layout

extjs

enter image description here

Hi~,

I want to set 100% left over height to panel 2. but I don't know how to do..

here is my test code,

{
    title : 'EAST',
    region : 'east',
    layout : 'vbox',
    layoutConfig : {
        align : 'stretch'
    },
    bodyStyle : 'border:1px solid blue',
    width: 300,
    items : [
        new Ext.Panel({
            title : 'Panel 1',
            border : true,
            layout : 'fit',
            height : 250,
            html : 'PANEL 1 AREA'
        }),
        new Ext.Panel({
            title : 'Panel 2',
            border : true,
            bodyStyle : 'border:1px solid red',
            layout : 'fit',
            html : 'PANEL 2 AREA'
        })
    ]
}

I tried, autoHeight : true and height : '100%' to panel 2 but it does not work.

anybody knows, please help me ~

thank you~!

like image 561
Expert wanna be Avatar asked Jan 07 '12 13:01

Expert wanna be


1 Answers

You should use flex property for the second panel.

new Ext.Panel({
    title : 'Panel 2',
    border : true,
    bodyStyle : 'border:1px solid red',
    layout : 'fit',
    html : 'PANEL 2 AREA',
    flex: 1
})
like image 196
Krzysztof Avatar answered Oct 21 '22 21:10

Krzysztof