PDA

View Full Version : How to handle the CheckBox state changing



Mike_javaJunior
19 Jun 2013, 10:10 PM
In my Grid I need to handle the changing of the state of the CheckBox to save changes right after it was changed

Mike_javaJunior
20 Jun 2013, 2:18 AM
I tried to do it this way:

column = new ColumnConfig();
column.setId("accepted");
column.setHeader("Accepted");
column.setWidth(55);


column.setRenderer(new GridCellRenderer() {
@Override
public Object render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore store, Grid grid) {
box = new CheckBox();
final ListStore<PropertyItem> st = store;
box.addListener(Events.CheckChanged, new Listener<CheckChangedEvent>() {
@Override
public void handleEvent(CheckChangedEvent be) {
st.commitChanges();
saveProperties(st, customerId, toRemove);
}
});


return box;
}
});
configs.add(column);

but the values doesn't correspond the values in the store and doesn't change them

alexpo
23 Apr 2014, 1:50 AM
We have similar problem too.
After adding new item to the Grid previous set CheckBoxes reset those values.
Any idea how to fix it?