Get position of cell after paste

Tags: #<Tag:0x00007efc64e99460>

I need to know the position of a cell in the table in order to validate it against its neighbors (rising and falling values across row). When just editing a cell I can use the beforeValidate function to get the row number and column name.

When you paste, the beforeValidate function is called once for every cell and then the validation function is run multiple times. The problem is then that the row and column will always be the same for every validation.

Shouldnt the before validation be run in between each call to the validation function?

After some more reading I realize that this may be due to beforeValidation or the validation function running async or synchronously. Would I need to put a wait in the beforeValidation function?

Hey @farrells

you can use afterSelectionEnd to get coordinates of a selected cell/area. To get the content of the cell you cann getDataAtCell or getCellMeta to check its metadata and if you need it as an element then getCell.

Answering your question

Shouldnt the before validation be run in between each call to the validation function?

the validateCells() method runs each time you change the data. It only doesn’t change when you initiate the table.