Updating a row instead of a single cell using afterChange

Tags: #<Tag:0x00007f0b038bb2c0>

Hello,

I am totally new to Angular and I’m currently working on handsontable. Is there a way to get all the changes in row of handsontable before passing the request to the backend? Currently, the changes are being passed to the backend every cell update.

Hi @eabardies

You can get all the changes as they are made within be beforeChange / afterChange hooks. But, if you prefer to get the new data once - you can call the getData() method.

1 Like

Hi @aleksandra_budnik,

Thank you for your reply. Do you mind making a demo?

The goal is to get all the changes of a row and when the cursor goes out of that changed row, then the call to update must be called.

Right now, what’s happening is if a cell is changed and the cursor moved to another cell (not another row), the call to update is always called.

Thank you.

We have a hook called beforeOnCellMouseOut and afterOnCellMouseOut but they run for each cell. I think that you could save the index of the previously existed row and the new one. However, I do not have a demo for that.
When it comes to gathering the data maybe, it will be easier for you to get the data of a row within the afterChange hook https://jsfiddle.net/g4mh72bv/? I believe that a user can change cells within one row but they also can move from one row to another and come back to the same row once again.

1 Like

This is really helpful, thank you so much for this! I really appreciate it. :slight_smile:

1 Like