bitkopf
9 Feb 2012, 12:42 PM
Hi,
i try to make multiple rows selectable through checkboxes in a grid without pressing Ctrl or Shift.
I have extracted my problem by this test case:
public class Test implements EntryPoint{
class Dummy extends BaseModel{
public Dummy() {
set("name", "Dummy" );
}
}
@Override
public void onModuleLoad() {
ListStore<Dummy> store = new ListStore<Dummy>();
store.add(new Dummy());
store.add(new Dummy());
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
CheckBoxSelectionModel<Dummy> sm = new CheckBoxSelectionModel<Dummy>();
sm.setSelectionMode(SelectionMode.SIMPLE);
columns.add(sm.getColumn());
ColumnConfig cc = new ColumnConfig("name", 100);
columns.add(cc);
ColumnModel cm = new ColumnModel(columns);
Grid<Dummy> grid = new Grid<Dummy>(store, cm);
RootPanel.get().add(grid);
}
}
"sm.setSelectionMode(SelectionMode.SIMPLE);" seems to be completely ignored. Why?
i try to make multiple rows selectable through checkboxes in a grid without pressing Ctrl or Shift.
I have extracted my problem by this test case:
public class Test implements EntryPoint{
class Dummy extends BaseModel{
public Dummy() {
set("name", "Dummy" );
}
}
@Override
public void onModuleLoad() {
ListStore<Dummy> store = new ListStore<Dummy>();
store.add(new Dummy());
store.add(new Dummy());
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
CheckBoxSelectionModel<Dummy> sm = new CheckBoxSelectionModel<Dummy>();
sm.setSelectionMode(SelectionMode.SIMPLE);
columns.add(sm.getColumn());
ColumnConfig cc = new ColumnConfig("name", 100);
columns.add(cc);
ColumnModel cm = new ColumnModel(columns);
Grid<Dummy> grid = new Grid<Dummy>(store, cm);
RootPanel.get().add(grid);
}
}
"sm.setSelectionMode(SelectionMode.SIMPLE);" seems to be completely ignored. Why?