PDA

View Full Version : How can i have the panel in the center of border layout



mirror51
1 Oct 2013, 12:11 AM
I am making the footer like this


{
// begin logo
region: 'south',
layout: 'column',
border: 0,
height: 80,
id: 'cps-footer',
bodyStyle: 'background:#fff',
items:[{
// begin logo
region: 'center',
layout: 'border',
border: 3,
height: 50,
width:300,
bodyStyle: 'background:#000;',

// end logo
},
{
// begin logo
region: 'center',
layout: 'border',
border: 3,
height: 50,
width:900,
bodyStyle: 'background:#000;',
items:[tbar],

// end logo
},
{
// begin logo
region: 'center',
layout: 'border',
border: 3,
height: 50,
width:300,
bodyStyle: 'background:#000;',

// end logo
}],



Basically i want to have three panels. i want to center the center panel with fixed width so that it always remian in center of the page.

I am not sure which layout to choose. any ideas

Farish
1 Oct 2013, 12:45 AM
you can only use each region once. the center panel should not be assigned a fixed height and width; it takes the remaining space left over by the other regions. the border layout wont help if you must have a west, east and center region. if you only need west or east (one of them), then instead of using center, assign region west or east to your panel and then assign it a fixed width.

the other option is to add the panels into an hbox and use width or flex configs. and then add the south panel below it.

ettavolt
1 Oct 2013, 10:22 PM
Some corrections.
The only requirements about regions is that container must have one and only one 'center' region. Others may be numerous.
It is possible to specify center of fixed size - just make sure that west and east have flex set.

Farish
1 Oct 2013, 10:44 PM
thanks ettavolt!