View Full Version : Why a ContentPanel gets a 100px height with a FitLayout ?
20 Sep 2011, 6:34 AM
I'm often suprized when i see that my ContentPanel gets a 100px (sort of default value, I don't know) height when I put a FitLayout on its parent (who have actually a 100% height)...
and I'm also surprized to see that I often need to set a 100% height with a FitLayout (that has a parent with an apparent full height too).
What can be the problem ?
20 Sep 2011, 9:16 AM
Can you post the code that you are using to set this up, and describe what it is you are trying to do? A FitLayout on the parent should mean that the child is sized to the available space in the parent, which could possibly be 100px, though without seeing more details it would be hard to say.
Giving that parent a 100% height using css is unlikely to do what you intend, as it will not be given that height through the layout system, and changes to its height (effected by css layouts) will not cause the gxt layout system to update correctly. Take a look at how the example layouts are built up, often using Viewport to size to the available space in the window.
20 Sep 2011, 11:45 PM
Thanks for your response !
I've find out where the problem was !
The Layout chain was broken in one Widget...
I understand the principle of the layout but i had not seen the bug before, my app has so many widgets !
A few words about the setHeight("100%") (and also setWidth)... indeed, give a widget a 100% height is useless even if the Layout chain is broken.
In this case (and perhaps others) I noticed that GXT applies a parseInt on the value given by setHeight ! For example, if you make setHeight("100%") on a widget, the widget will have a 100px height. You don't believe that ? ^^ Try 200% :p
In addition, use Firebug or other equivalent tools !
If you see a style="height: 100%" on a full height container : your layout chain is probably broken because the height should normally be specified in pixels.
Hoping that it will be helpful for the following
Powered by vBulletin® Version 4.1.5 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.