Hi all,
I'm having a bit of a problem with the height of a grid and the vertical scrollbar. Somehow, the bottom of the grid falls of the screen, as well as the bottom of the scrollbar.
However, if a click on an editable cell, the scrollbar does fit on the screen, but the grid headers are not displayed.
See this screenshot for the initial situation: grid_before_click.jpg
And this one after clicking on an editable cell: grid_after_click.jpg
This is the code responsible for creating the grid:
Code:
public class RoleGrid extends LayoutContainer {
private EditorGrid<BeanModel> roleGrid;
private ColumnModel columnModel;
private ContentPanel contentPanel;
public RoleGrid() {
initialize();
createGrid();
}
protected void initialize() {
setLayout(new FlowLayout());
contentPanel = new ContentPanel();
contentPanel.setHeading("Roles");
contentPanel.setBorders(false);
contentPanel.setHeight(600);
contentPanel.setLayout(new FitLayout());
}
protected void createGrid() {
List<ColumnConfig> columnConfig = new ArrayList<ColumnConfig>();
columnConfig.add(new RowNumberer());
ColumnConfig nameColumn = new ColumnConfig();
.
.
.
columnModel = new ColumnModel(columnConfig);
roleGrid = new EditorGrid<BeanModel>(new ListStore<BeanModel>(), columnModel);
roleGrid.setEnableColumnResize(true);
roleGrid.setAutoExpandColumn("name");
roleGrid.getView().setForceFit(true);
contentPanel.add(roleGrid);
add(contentPanel);
}
}
Any ideas why this is?
Cheers,
Jippe