I have a Datagrid which I am placing inside a FlowPanel. However, this datagrid is not visible unless I explicitly set its size by doing datagrid.setSize("100%", "250px")
.
I want the datagrid's width to be 100% but I want its height to change according to the number of rows in it. When is only do datagrid.setWidth("100%")
the datagrid is still not visible. How do overcome this problem?
DataGrid
needs to either have an explicit size or be put into a LayoutPanel
and you must ensure an unbroken chain of LayoutPanels
up to the RoutLayoutPanel
.
Here are some possible solutions:
CellTable
instead of DataGrid
.getOffsetHeight
on the FlowPanel
) and manually set the height accordingly.