-
22 Jan 2013 9:19 PM #1
No header appearance GridView constructor
No header appearance GridView constructor
GXT 3.0.2b
The only way I have been able to assign a header appearance to a GridView is by overriding the initColumnHeader() in GridView. Please introduce a constructor, copy and pasting this much code for every different GridView header I have is painful, redundant, and hard to maintain.
@Override
protected void initColumnHeader() {
header = new ColumnHeader<M>(grid, cm, new myColumnHeaderAppearance()) {
@Override
protected Menu getContextMenu(int column) {
return createContextMenu(column);
}
@Override
protected void onColumnSplitterMoved(int colIndex, int width) {
super.onColumnSplitterMoved(colIndex, width);
TaskManagerGridView.this.onColumnSplitterMoved(colIndex, width);
}
@Override
protected void onHeaderClick(Event ce, int column) {
super.onHeaderClick(ce, column);
TaskManagerGridView.this.onHeaderClick(column);
}
@Override
protected void onKeyDown(Event ce, int index) {
ce.stopPropagation();
// auto select on key down
if (grid.getSelectionModel() instanceof CellSelectionModel<?>) {
CellSelectionModel<?> csm = (CellSelectionModel<?>) grid.getSelectionModel();
csm.selectCell(0, index);
} else {
grid.getSelectionModel().select(0, false);
}
}
};
header.setSplitterWidth(splitterWidth);
header.setMinColumnWidth(grid.getMinColumnWidth());
}
Thanks,
Audra
You found a bug! We've classified it as
EXTGWT-2772
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote