PDA

View Full Version : Resizing panels without a border layout



da_b0uncer
12 Mar 2013, 5:39 AM
If I have 2 panels in a hbox and want to have one of them to have "resizable" width.
I read about the border-layout being rather heavyweight, so I don't want to use it for just 2 panels.

Is this possible?

slemmon
12 Mar 2013, 7:55 AM
Check out the Ext.resizer.Splitter (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.resizer.Splitter) class. I think it'll be what you're looking for.



Ext.widget('container', {
renderTo: Ext.getBody()
, width: 300
, height: 100
, layout: {
type: 'hbox'
, align: 'stretch'
}
, items: [{
xtype: 'panel'
, title: 'Left'
, flex: 1
} ,{
xtype: 'splitter'
}, {
xtype: 'panel'
, title: 'right'
, flex: 1
}]
});