PDA

View Full Version : check box event in data grid



avilanchee
7 May 2009, 11:22 PM
Guys,

I have a datagrid with checkBox column . I need to save the state of the checkbox to the grid store . say i uncheck it, the value should be false and it should be committed to the grid . I tried using checkChange event , no success . Any help would be highly appreciated!

avilanchee
7 May 2009, 11:29 PM
private Grid<SectionGridModel> getSubSectionsGrid() {
if (subSectionGrid == null) {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Name");
column.setWidth(75);
configs.add(column);

column = new ColumnConfig();
column.setId("englishname");
column.setHeader("English Name");
column.setWidth(75);
configs.add(column);

column = new ColumnConfig();
column.setId("url");
column.setHeader("Url");
column.setWidth(75);
configs.add(column);

column = new ColumnConfig();
column.setId("type");
column.setHeader("type");
column.setWidth(75);
configs.add(column);

CheckColumnConfig checkColumn = new CheckColumnConfig("yesorno", "In Use?", 55);
configs.add(checkColumn);

column = new ColumnConfig();
column.setId("inuse");
column.setHeader("In Use");
column.setWidth(75);
configs.add(column);

column = new ColumnConfig();
column.setId("image");
column.setHeader("Image");
column.setWidth(75);
configs.add(column);

store = new ListStore<SectionGridModel>();
store.setMonitorChanges(true);

ColumnModel cm = new ColumnModel(configs);
subSectionGrid = new Grid<SectionGridModel>(store, cm);
subSectionGrid.addPlugin(checkColumn);
subSectionGrid.setBorders(true);
subSectionGrid.setAutoExpandColumn("name");

}
return subSectionGrid;
}