Validator cell

Tags: #<Tag:0x00007efc65155c58> #<Tag:0x00007efc65155b18>

Hello dear

how to validate single cell value in react (i read handsontable validate documentation but its not working)

i tried this and need to validate in add row

validate%20code

i think validate is not working its taking wrong value not showing error border , background or something…

eeror

pls help me

Thank you

Hi @munkhtulgaworks

There’s a method called validateCell() at https://handsontable.com/docs/javascript-data-grid/api/core/#validatecell and it will validate only that single cell. The thing you do in that snippet is adding a validator for (as I suppose, cause the image is cut) the whole column.

Now the validation does not run after table initialization, even if you set up a custom validator as you did in the code above. That is why you can either

  • validate cells automatically (and that happens when user edits any data in the table, then the whole table rerenders and validates values
  • validate cell/cells programmatically as with the validateCell() method.