Hi, i do trying to clear a cell after cell filled with invalid data.
Do try to use a hook afterValidate and change value of the cell to null if validator return false for validation.
This that i do use:
afterValidate: function (isValid, value,row,prop, source) {
if (isValid == false) {
hot.selectCell(row, prop);
hot.setDataAtCell(row, prop, null,source);
}
}
Code is partly works, but after setDataAtCell set a value for a cell fire again afterValidate hook and already return true value and clearing cell do not happen.
How to do that right way, or maybe use some another hook for this (and how check a validity then)?
Yeah, in your example it works. But in my code it doesn’t. And in your code it is stop working if remove data tag from initialization. The point is, i need empty cell without populated data with numeric validation which is clearing if user type in that field not a numeric value. The field is not a date. Just a numeric field.