Reload data on handsontable

Tags: #<Tag:0x00007efc6b496e98>

Hi There!
I have 2 different components where I’m using handsontable and my question is, I’m using the afterChange hook to update the data in table 1(as the user inputs new data), which works perfectly, but I also need the 2nd table (which is a read only table) to update the data as it’s changed on table 1. I’m not sure where to go from here, any help is much appreciated! (I’m using React)
Here’s the code for both tables.
table 1:


table 2:

both my tables are classes extending components
thank you!!

Hi @adelleanik

wouldn’t a simple variable load by import help?

I’ve just made a simple project with two tables on the same page communicating in the way that
Once I made an edit in hot1 I save the last change index of row and column and table size to a global variable and then read those values in hot2 via afterOnCellMouseDown (to test it fast).

If that would help I can send you the project zipped.

Hi, thank you so much for your response :slight_smile:
I tried using useState and passing the variable through props, but that didn’t work very well.
I’d really appreciate it if you could send me the project zipped.
thanks again. I just recently started coding in react and using handsontable, so I really appreciate you taking the time to reply :smiley:

Sure, you can download the file here https://we.tl/t-IhwmqVN7LX
Just make sure to use npm i cause I removed the node_modules for a smaller zip size.

Hi @adelleanik

How is the progress going? Did you manage to set up everything as planned?