Async operation on events triggered

Tags: #<Tag:0x00007f249285dd70>

I want to execute async operation (such as server input validation) when some events are triggered. For instance a simple use case :

  • I edit a cell
  • I call my server with the new data, my server validates and persist my new cell data in database, my server return my updated cell value
  • my cell is updated
    So far I can’t find a way to do this. Am I wrong if I say that Handsontable only supports synchronous operations ?

Hi @linadeb753

validation in Handsontable is asynchronous (if you connect the logic to your server I recommend using the afterValidate() hook). But in your case if the cell is not validated on the front-end you just need to use a single setCellMeta() to attach cell meta indicating the invalid status of the cell, and setDataAtCell()/setDataAtRowProp() if you want to alter the cell after your response from the server.
But, there’s one thing to remember - that at the moment, you cannot rerender only a single cell. Handsontable rerenders all of the cells in the viewport + a couple more rows and columns for a smooth scroll experience.