View Full Version : Maximazing height of TreeGrid in LayoutContainer

7 Sep 2009, 8:20 AM

I have a TabItem to which I am adding 3 things:
1) ToolBar
2) LayoutContainer
3) Another ToolBar

The LayoutContainer holds just 1 component: TreeGrid.

I have set this LayoutContainer's layout to FitLayout(), but to no avail... The tab in which these 3 main components are in still shows the LayoutContainer which holds the TreeGrid without expanding it to fill the window space, so what I end up seeing is the first toolbar, the first/root item in the tree grid and then the second toolbar... Then, it's just white space.

I did enable the TabItem's setBorders and I can see that TabItem's border expands all the way as it should since it too has a setLayout(new FitLayout()) on it.

How do I get the middle (#2 in the list above) LayoutContainer to expand as much as the space will allow?

BTW, if inside that LayoutContainer I set the treeGrid's instance setHeight(300) or something like that, the LayoutContainer will show 300 pixels of height... However, I need it to expand to fill as much as there is space.


7 Sep 2009, 8:37 AM
You should try to post an example of the code you have and explain in detail how you want it to work.

The example should implement EntryPoint so that everybody is able to run it.

8 Sep 2009, 11:43 AM
My app is being developed on a Internet-disconnected network at a customer's site and I can't just "paste it in"... I'll try to recreate the same case and post the code here. Hopefully, someone can let me know what I am doing wrong.



16 Sep 2009, 10:05 AM
note: FitLayout only display the first Component maximized.

so place it in a other component. and then use a borderlayout with your toolbar in north the grid in center and other toolbar in south.

look at contentpanel: there you have already 2 toolbars: on top and on bottom! maybe you can use this your your case!