eugenparaschiv
27 Aug 2008, 7:06 AM
How can I get rid of the scroll bars on a Table; I want the scroll bars to appear only if needed, but know they appear no matter what and I cannot get rid of them. I tried to call:
table.setHorizontalScroll(false); but I see no change. I want to get rid of both the horizontal and the vertical scroll bar. Any ideas how I can do that? Here is the sample. Thanks.
public void onModuleLoad() {
Viewport view = new Viewport();
view.setLayoutOnChange(false);
ContentPanel mainPanel = new ContentPanel( );
mainPanel.setLayoutOnChange(false);
mainPanel.setSize(1000, 600);
//table
final List<TableColumn> columns = new ArrayList<TableColumn>();
TableColumn col = new TableColumn("name","Contact Name", .6f); //id, text, width
col.setMinWidth(100);
col.setMaxWidth(150);
columns.add(col);
col = new TableColumn("other","Other data", .4f); //id, text, width
col.setMinWidth(75);
col.setMaxWidth(125);
columns.add(col);
//the model for the columns of the table
final TableColumnModel colModel = new TableColumnModel(columns);
//the actual table (based on the model)
final Table table = new Table(colModel);
table.setSelectionMode(SelectionMode.SINGLE);
table.setBorders(false);
table.setHorizontalScroll(false);
table.setVerticalLines(true);
table.setSize(200, 500);
//add the table to this table panel
mainPanel.add(table);
view.add( mainPanel );
RootPanel.get().add( view );
view.layout();
}
table.setHorizontalScroll(false); but I see no change. I want to get rid of both the horizontal and the vertical scroll bar. Any ideas how I can do that? Here is the sample. Thanks.
public void onModuleLoad() {
Viewport view = new Viewport();
view.setLayoutOnChange(false);
ContentPanel mainPanel = new ContentPanel( );
mainPanel.setLayoutOnChange(false);
mainPanel.setSize(1000, 600);
//table
final List<TableColumn> columns = new ArrayList<TableColumn>();
TableColumn col = new TableColumn("name","Contact Name", .6f); //id, text, width
col.setMinWidth(100);
col.setMaxWidth(150);
columns.add(col);
col = new TableColumn("other","Other data", .4f); //id, text, width
col.setMinWidth(75);
col.setMaxWidth(125);
columns.add(col);
//the model for the columns of the table
final TableColumnModel colModel = new TableColumnModel(columns);
//the actual table (based on the model)
final Table table = new Table(colModel);
table.setSelectionMode(SelectionMode.SINGLE);
table.setBorders(false);
table.setHorizontalScroll(false);
table.setVerticalLines(true);
table.setSize(200, 500);
//add the table to this table panel
mainPanel.add(table);
view.add( mainPanel );
RootPanel.get().add( view );
view.layout();
}