PDA

View Full Version : Not needed to declare width or height properties in components inside a borderlayout



neo1010
18 Oct 2014, 7:46 AM
Hy,

A have a viewport wih layout border that has two items: one GridPanel and TreePanel. The documentation says that "the layout in the container will manage the size and position of the child components". So I am not declaring any width or height properties in GridPanel and neither TreePanel but I am getting this error when I comment these properties from TreePanel: "Layout run failed ".

Thanks

tvanzoelen
19 Oct 2014, 11:54 AM
Its in the docs: http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.layout.container.Border



Any child items with a region of west or east may be configured with either an initial width, or a Ext.layout.container.Box.flex value, or an initial percentage width string (Which is simply divided by 100 and used as a flex value). The 'center' region has a flex value of 1.

Any child items with a region of north or south may be configured with either an initial height, or a Ext.layout.container.Box.flex value, or an initial percentage height string (Which is simply divided by 100 and used as a flex value). The 'center' region has a flex value of 1.

In summary:
west and east regions needs a width and north and south regions needs a height. Or set a flex value.
Or did you forget to set the region property on one of your items? There is only one center region...

neo1010
19 Oct 2014, 3:39 PM
I think the only layout that lets dont specify the width or height in child components is fit, right?

Thanks.

slemmon
19 Oct 2014, 8:43 PM
Good to see you on the forums, @tvanzoelen.