PDA

View Full Version : 2 west regions



baest
17 Feb 2011, 8:17 AM
Hi,

any ideas on how to make a layout like the standard west, center, east border layout, but with 2 west regions? That is the center in the east and 2 smaller regions in the west. The smaller regions needs both to be collapsible. They are different search regions (with the center region being the results) and the design requires the possibility of collapsing them one by one.

I have tried several possibilities. The closet was with Ext.layout.ColumnLayout, but then the center block doesn't grab the space the collapsed column used.

Martin

johnathanhebert
17 Feb 2011, 8:43 AM
You could do a border layout within another border layout... something like:



{
layout:'border',
items:[{
region:'west',
width:200,
collapsible:true
},{
region:'center',
layout:'border',
items:[{
region:'west',
width:200,
collapsible:true
},{
region:'center'
}]
}]
}

johnathanhebert
17 Feb 2011, 8:44 AM
You may have to use css to hide some borders, etc to make it look right

mitchellsimoens
17 Feb 2011, 11:16 AM
Don't always have to use BorderLayout... Your west region could be a Container using ColumnLayout or HBoxLayout

baest
17 Feb 2011, 12:14 PM
@PMjohnathanhebert
It works perfectly. Thanks!! I was locked in trying to have two west in the same or putting the second west inside the other west column.

@mitchellsimoens
I tried that before creating this thread, but didn't have any success. Maybe it's just me. Thanks

mitchellsimoens
17 Feb 2011, 12:16 PM
Are you needing to be able to have collapsible panels? If not then BorderLayout may be a bit much for what you want. If you don't care about having absolute best performance then go for the easiest route.

baest
17 Feb 2011, 12:18 PM
Yes, I need collapsible panels. Otherwise yes the ColumnLayout would be be a perfect fit