lundi 14 avril 2014

How to disable and enable the cell in EditorGrid in GXT 2.2.3

I created EditorGrid using GXT 2.2.3.Now I am trying to disable and enable a cell based on the value in another cell i.e. SimpleComboBox.I tried the below code

Code:



Listener<GridEvent<AttendanceCaseCreationModel>> gridAfterEditListener = new Listener<GridEvent<AttendanceCaseCreationModel>>() { @Override public void handleEvent(GridEvent<AttendanceCaseCreationModel> be) { AttendanceCaseCreationModel data = be.getModel(); String val = data.get("event"); if(val.equalsIgnoreCase("Remove Attendance")){ data.set("checkinDate",""); grid.getColumnModel().getColumnById("checkinDate").getEditor().disable(); grid.getStore().update(data); grid.getView().refresh(true); } else { data.set("checkinDate",""); grid.getColumnModel().getColumnById("checkinDate").getEditor().enable(); grid.getStore().update(data); grid.getView().refresh(true); } } }; grid.addListener(Events.AfterEdit, gridAfterEditListener);

But it's not working for my expectation.Its disabling the entire column and not enabling once it's disabled.

My requirement is to disable and enable the cell based on the another cell value in the EditorGrid of GXT 2.2.3.





Aucun commentaire:

Enregistrer un commentaire