com.google.gwt.user.client.ui.ScrollPanel and com.google.gwt.user.client.ui.FlexTable helps in creating scrollable table.
We came across a requirement to build a scrollable data table using Google Web Toolkit (GWT) because we had a limited space, but a growing table depending on the search criteria. As anyone can guess, having a scrollable table would be the best option. For that we used two components rather than one.
For clarification, we have added the code below.
For setting width and height; it's advised to use CSS rules, but for ease of understanding we have shown some hard coded values here.
com.google.gwt.user.client.ui.ScrollPanel and com.google.gwt.user.client.ui.FlexTable.The data table was added inside the Scrollable Panel.
For clarification, we have added the code below.
ScrollPanel scrollPanel = new ScrollPanel();
FlexTable dataTable = new FlexTable();
dataTable.setWidth("100%");
scrollPanel.add(dataTable);
scrollPanel.setSize("300", "200");
// add data to table
// ....
For setting width and height; it's advised to use CSS rules, but for ease of understanding we have shown some hard coded values here.
COMMENTS