Get row number in column validator

Hello,

The validation function from a column only has the value and the callback function as parameters (function (value, callback)). I can’t seem to find a way to get the row number for the validated value (and eventually the column number) since I have to correlate the validation of a cell with a value from another cell.

Is there any workaround?

Thank you!

Hi @costin.ochescu
If you would like to get more details about the validation process you can use the aftervalidate hook, here’s more about it: https://docs.handsontable.com/pro/1.7.0/Hooks.html#event:afterValidate
and if you would like to get a column instead of property than use can use the propToCol() method.

If I’ve misunderstood your request please share more details about the expected result.

Hi @costin.ochescu,

You can retrieve all information about edited cell using function context this. in you validation function. I’ve created demo at http://jsfiddle.net/budnix/55ovwtn0/ where you can see how to grab row and column when validation was triggered.