Large SmartGWT ListGrid in TabPanel, how to get one set of scroll bars

1.3k Views Asked by At

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

2

There are 2 best solutions below

0
On BEST ANSWER

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.

2
On

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%".