I have built a very simple grid with checkbox and name columns. For some reason the checkboxes themselves seem like they are read-only. I have to click the actual row to get the box to populate. This removes the ability to use the header checkbox to select/deselect all.
Code that builds grid:
Code:
public void buildGrid() {
IdentityValueProvider<SystemModuleDTO> indentity = new IdentityValueProvider<SystemModuleDTO>();
final CheckBoxSelectionModel<SystemModuleDTO> sm = new CheckBoxSelectionModel<SystemModuleDTO>(
indentity);
ColumnConfig<SystemModuleDTO, String> nameColumn = new ColumnConfig<SystemModuleDTO, String>(
props.getName(), 200, "Name");
List<ColumnConfig<SystemModuleDTO, ?>> l = new ArrayList<ColumnConfig<SystemModuleDTO, ?>>();
l.add(sm.getColumn());
l.add(nameColumn);
ColumnModel<SystemModuleDTO> cm = new ColumnModel<SystemModuleDTO>(l);
ListStore<SystemModuleDTO> store = new ListStore<SystemModuleDTO>(
props.key());
grid = new Grid<SystemModuleDTO>(store, cm);
grid.setSelectionModel(sm);
grid.getView().setAutoExpandColumn(nameColumn);
grid.getView().setStripeRows(true);
grid.getView().setColumnLines(true);
sm.setSelectionMode(SelectionMode.MULTI);
SystemModuleDTO sample = new SystemModuleDTO();
sample.setId(1);
sample.setName("Corporate Video");
SystemModuleDTO sample2 = new SystemModuleDTO();
sample2.setId(2);
sample2.setName("Corporate Video");
store.add(sample);
store.add(sample2);
}
Video that shows my issue: