Hi, I have a shinyapp, in which there are two tables that are generated with rhandsontable package. table_1 (hot) is totally independent of table_2 (hot2), but in table_2 there are some columns that are calculated from user inputs (in table_2) and the values from table_1 (like column F in the below example). In table_1, user should be able to insert or remove rows (one row or multiple rows). How can I remove the same rows in table_2, that the user has just removed in table_1?
Thank you @raytong for the reply, but it doesn't solve the problem. Actually, by removing rows in table_1, dat$A will become a vector shorter than dat2$D, but it doesn't result in NA in dat2$F. R will handle it the way it deals with adding two vectors with different elements. You can test it and see that the corresponding rows in table_2, are not deleted in the app.
@moji. Sorry for misunderstand your question. rhandsontable have a feature that including the recently change event and argument in the input value. So, you can check if the row are removed from the table hot. If yes, use the row index in int and ct to remove the rows in table hot2.
It was a great solution if it would be possible to prevent users from multi-row selection. If I select only one row and remove it, it works fine; but if I select two rows (for example 2 and 4) and remove them, what happens is that only one row (and surprisingly in this example: row 3 !!!) will be removed. I don't know if it is a bug of the package or not, but what is important is that such behaviors make the app unstable and error-prone.