I’m trying to validate a single cell in my datatable. The basics of my implementation looks like this:
onAfterEditStop:function(state, editor) {
if (this.validate(editor.row)) {
// validated
}
}
This code validates all the cells in a row but I would like it to only validate the cell that was edited. Can someone explain to me how to accomplish this?
The validate() method for data components is implemented in the following way:
no argument - the whole component data is validated;
item ID as an argument - the whole item data is validated (here: datatable row with the given ID).
So if there’s invalid data in any cell of a datatable row, it will be highlighted as invalid and the cell with invalid data will be additionally marked.