Jose
Jose

Reputation: 41

GWT DataGrid automatic height

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?

Upvotes: 8

Views: 8820

Answers (2)

S.Heitz
S.Heitz

Reputation: 31

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.

Upvotes: 3

Thomas Broyer
Thomas Broyer

Reputation: 64541

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?

Upvotes: 19

Related Questions