PDA

View Full Version : Grid.setAutoExpandColumn works only after click on the grid



CHEM_Eugene
20 Mar 2012, 12:58 AM
Hi!

How I can force column expanding ? I'd like to see expanded column immediately after rendering.
Now I use Grid.setAutoExpandColumn, but it works only after I click on the table. Before click I have horizontal scroll bar in the table. After click scroll bar disappears. I'd like scroll bar was never seen.



ColumnConfig column = new ColumnConfig();
column.setId("caption");
column.setHeader(labels.caption());
column.setWidth(100);
column.setRowHeader(true);
configs.add(column);

selectionModel = new CheckBoxSelectionModel<EntityProxyModel>();

grid = new Grid<EntityProxyModel>(store, cm);
grid.setStyleAttribute("borderTop", "none");
grid.setAutoExpandColumn("caption");
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
grid.setColumnReordering(true);
grid.setAutoHeight(true);
grid.setSelectionModel(selectionModel);
grid.addPlugin(selectionModel);

panel = new FlowPanel();
panel.add(grid);
initWidget(panel);