Can beforeRemoveRow perform an async action?

Tags: #<Tag:0x00007f8b19822b10>

Expectation:
beforeRemoveRow performs an async action (go to database) and then returns false/true. In case of ‘false’ I expect the row to NOT be removed from the table.

Behavior:
Even if I return ‘false’ from beforeRemoveRow, the row gets deleted.

Example:
The hook’s callback looks something like this:
async function () => { return false }

I am wondering if it has to do with the ‘async’ keyword?
When I remove the ‘async’ syntax and go with with promise .then it behaves as expected and does not delete the row. However, in this case it fails to perform the async action before deleting the row.

(Actually this is a post continuing the last suggestion from
beforeRemoveRow, I need send the data to server and wait the response)

Hi @quynh.totuan

the hook is currently running synchronously and only by returning false you’re able to cancel the action.
As I see the last comment suggested to make it work async, which is a good idea. However, currently, Handsontable work only on synchronous calls and it would be impossible to change only one hook.