IGX-grid uncontrollable edit event #12218
-
Hi, In my IGX gird when one row is toggled to edit mode other cells from different row are also editable. I want to restrict user from editing cells from other row. please provide me with a solution |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @kevalgw, Since it's not mentioned I'm not too sure if you're using cell editing or row editing mode. In cell editing mode you will have a boolean flag to check if a cell is currently being edited or not, you will also have a row index variable and a variable to hold the cell being edited. You will handle the cellEditEnter event of the grid and when it fires, you will check whether a cell is currently being edited or not, if it is not being edited, the flag will be set to true, the index of the given row and the cell being edited will be taken. In the other case, when the event is executed and a given cell is currently being edited, it will be checked whether the index of the row that starts to be edited and the index of the row that is being edited at the moment are the same, if they are the same, the editing of the cells will continue from this row, if the indexes are different, the event will be canceled and the last edited cell will return to edit mode.
The boolean flag will only be set to false when editing is complete when the grid's cellEditDone event fires.
Here you can find a sample that illustrates the described scenarios. In row editing mode, you will again have the boolean flag to check whether a row is currently being edited or not, as well as a variable for the index of the row and for the cell being edited. You will handle the cellEditEnter event and again the procedure is the same. However, rowEditEnter will also be handled here because it is executed when the row is edited in row editing mode and it will be checked whether it is currently being edited and if so, it will be checked whether the index of the row that starts to be edited and the index of the row that is being edited at the moment are different, and if they are different, the event will be canceled and the last taken cell will be returned in edit mode.
The boolean flag will be set to false again when firing the cellEditDone event as well as rowEditDone and rowEditExit events only when editing is complete with the ‘Done’ and ‘Cancel’ buttons pressed.
In addition, I have prepared small sample illustrating this behavior which could be found here. |
Beta Was this translation helpful? Give feedback.
Hello @kevalgw,
Since it's not mentioned I'm not too sure if you're using cell editing or row editing mode.
In cell editing mode you will have a boolean flag to check if a cell is currently being edited or not, you will also have a row index variable and a variable to hold the cell being edited. You will handle the cellEditEnter event of the grid and when it fires, you will check whether a cell is currently being edited or not, if it is not being edited, the flag will be set to true, the index of the given row and the cell being edited will be taken. In the other case, when the event is executed and a given cell is currently being edited, it will be checked whether the index of the row th…