PDA

View Full Version : How to get row model of grid from CellEditor?



Blessed Geek
23 Mar 2012, 1:50 AM
The following is my code. I would like to know how to intercept the CellEditor, so that every time user clicks on "selected"/"Paid" checkbox of any row, I wish to dispatch the model data of that row to another presenter (presenter as in MVP).



static public ColumnModel mkColumnModel() {
return new ColumnModel(mkColumnConfigs());
}

static CheckColumnConfig checkColumnConfig =
new CheckColumnConfig("selected", "Paid", 10);

static private ColumnConfig[] columns =
{
checkColumnConfig,
new ColumnConfig("name", "Name", 100),
new ColumnConfig("description", "Description", 100),
new ColumnConfig("aisle", "Shelf Ref", 100),
};


static private List<ColumnConfig> mkColumnConfigs(){
CellEditor checkBoxEditor = new CellEditor(new CheckBox());
columns[0].setEditor(checkBoxEditor);

List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
for(ColumnConfig column : columns) {
configs.add(column);
}

return configs;
}