Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT DataGrid automatic height

Tags:

datagrid

gwt

I'm trying to insert a gwt datagrid in my application. If i set a static height (500px) everything works nice. But i want to make the dataGrid auto adjust to screen size. With height 100% i get a blank screen. i've also tried to put the datagrid into a resizeLayoutPanel with the same results.

any tips?

like image 754
Jose Avatar asked Oct 24 '11 10:10

Jose


2 Answers

All RequiresResize widgets should be given an explicit size, or be added to ProvidesResize widgets (up to a RootLayoutPanel or a ProvidesResize widget with an explicit size; the only exception is ResizeLayoutPanel which doesn't implement ProvidesResize because it couldn't honor the contract for its header and footer widgets, but it definitely honors it for the center widget).

So the question is: where did you add your DataGrid and/or ResizeLayoutPanel?

like image 131
Thomas Broyer Avatar answered Nov 18 '22 13:11

Thomas Broyer


Thomas Broyer is correct. Nonetheless I found something of interest concerning the DataGrid (it does not happen in CellTable). If you are using a DeckPanel and if you are creating the DataGrid on a hidden Panel of this DeckPanel, than the data of the DataGrid will not be visible if you show the panel of the DataGrid. I found only one workaround: call addDataDisplay of your DataProvider "after" the panel was made visible.

like image 45
S.Heitz Avatar answered Nov 18 '22 15:11

S.Heitz