I'm using the rhandsontable
package and would like to add a context menu option for adding multiple rows to the handsontable
produced. I've tried to adapt this example into my R equivalent with no luck. I believe my javascript
is the issue but don't have the experience to spot what's wrong.
How can I add a custom context menu item for adding multiple rows? Thanks in advance.
Reprex
library(rhandsontable)
iris %>%
head(5) %>%
rhandsontable() %>%
hot_context_menu(customOpts =
list(
name = "Add 5 rows at the top",
callback = htmlwidgets::JS(
"function (key, options) {
this.alter('insert_row', 1, 5);
this.render();
}"
)
))