PDA

View Full Version : Any way to have a component take 100% height of a Panel?



tdondich
25 Nov 2007, 12:31 AM
I want to add a grid control to my Panel, but I'd like it to take up 100% of my Panel's space. Any proper way to do this?

alamandrax
25 Nov 2007, 12:43 AM
I've tried to add a GridPanel to the "center" panel of my border-layout, but I've had a lot of problems getting it to fit the entire center panel. auto-width didn't seem to work.

My quick fix was to place the GridPanel configuration directly into the center panel.

You might also want to try looking at the Ext GUI builder (http://tof2k.com/ext/formbuilder/#).

Good luck! :)

Animal
25 Nov 2007, 1:07 AM
I want to add a grid control to my Panel, but I'd like it to take up 100% of my Panel's space. Any proper way to do this?

Give the parent Panel layout:'fit'

That's exactly what that's for.

SeaSharp
25 Nov 2007, 1:10 AM
layout:'fit',

Beware of other config properties that sound as though they might achieve the same effect, these can upset the fit layout.

From the docs:

FitLayout does not have any direct config options (other than inherited ones). To fit a panel to a container using FitLayout, simply set layout:'fit' on the container and add a single panel to it. If the container has multiple panels, only the first one will be displayed.