Hi I am creating Editable Grid using GXT 2.2.3. I created columns like below:
List eventList=new ArrayList();
eventList.ad
How to make cell as non editable based on another cell value in Editable Grid in gxt.
Try with BeforeEdit
listener and call event.setCancelled(true)
on the basis of your condition to disable the editing.
There is no need to disable/enable the cell. Just stop editing in current cell based on condition.
Sample code:
grid.addListener(Events.BeforeEdit, new Listener>() {
public void handleEvent(GridEvent be) {
// disable 2nd cell based on value of 1st cell
ModelData data = be.getModel();
String val = data.get("event"); // read 1st cell value
if (val.equalsIgnoreCase("Remove Attendance")) {
if (be.getColIndex() == 2) { // disable 2nd cell only
be.setCancelled(true);// Disable edition
}
}
}
});
Please have a look at complete sample code.