【发布时间】:2020-12-16 12:57:25
【问题描述】:
我正在使用rhandsontablepackage,并想添加一个上下文菜单选项,用于向生成的handsontable 添加多行。我试图将 this 示例改编为我的 R 等效项,但没有成功。我相信我的javascript 是问题所在,但没有发现问题所在的经验。
如何添加自定义上下文菜单项以添加多行?提前致谢。
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();
}"
)
))
【问题讨论】:
标签: javascript r handsontable rhandsontable