Question

I have a potentially very large ListGrid that is one panel of a GWT TabPanel. Even giving it a width of 2000 pixels and a height of 6000 pixels, it does not fit in either dimension. Which means I end up with a vertical scroll bar for the TabPanel (the screen isn't 6000 px high) and horizontal and vertical scrollbars for the ListGrid.

So users will have very few items in this ListGrid, while others will have hundreds of lines. Is there a way to tell the ListGrid to just fit the size of the enclosing panel, and only have one set of scrollbars?

Thank you, Greg

Was it helpful?

Solution 2

Ok, found the answer:

theGrid.setAutoFitData (Autofit.VERTICAL);
theGrid.setHeight (1);
theGrid.setShowAllRecords (true);
theGrid.setBodyOverflow (Overflow.VISIBLE);
theGrid.setOverflow (Overflow.VISIBLE);
theGrid.setLeaveScrollbarGap (false);

This sets up the ListGrid so that it changes size based on the number of rows it has, and does not restrict its size to the viewable area.

OTHER TIPS

Have you tried calling setWidth100() and setHeight100()?

listGrid.setWidth100();
listGrid.setHeight100();

Calling these methods is the SmartGWT equivalent of setting the width and height to "100%".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top