How to validate a cell by using row and column dynamically

Tags: #<Tag:0x00007f4527241e68>

I have 5 columns in table , I need to validate for column 3,4 after any change in table

For validating row:

Handson_SubTaskTable.validateRows([change[0][0]], (valid) => {
})

For validating column:
Handson_SubTaskTable.validateColumns([ 4, 5], (valid) => {
})

Is there any option that I can validate cell alone for given row and colum?Please help me in this.

Hi @vedaselvaraj27

When the user changes a single value in the cell table is repainted, and all attached validators run automatically. You can trigger the validation process programmatically by calling

  • validateCells - called for all of the cells in the table
  • validateRow
  • validateColumn

There is no method for a single cell. However, the afterValidate hook can return information about the coordinates of cells that are invalid.

what is the use of
this.validateCell=function(e,t,n,r){
}

in
Version: 9.0.0

  • Release date: 01/06/2021 (built at 31/05/2021 17:38:11) js file?

that is a great question! I’ve asked our developer and he said that someone might have forgot to add this method to public. I’ve asked our Tech Writer to create docs for this method https://github.com/handsontable/handsontable/issues/8849 it does not work exactly as those method for other coordinates as we do not pass the row and column index. Here https://github.com/handsontable/handsontable/blob/1443e4eda1c8bd61c58a5c7bd5ea6a4b104a5988/src/plugins/formulas/formulas.js#L515 is an example of use.