启用RHandsonTable中的注释,但禁用上下文菜单?

问题描述

我想在我的电子书中添加评论,但是我不想启用上下文菜单(允许用户添加删除行,编辑评论等)。我该怎么办?

library(rhandsontable)

vt <- mtcars
modrows <- c(3,6,9)
modtext <- LETTERS[1:3]
vttooltips <- matrix(ncol = ncol(vt),nrow = nrow(vt))
vttooltips[modrows,2] <- modtext

rhandsontable(vt,comments = vttooltips) %>% 
  hot_context_menu(allowRowEdit = FALSE,allowColEdit = FALSE,allowReadOnly = FALSE,allowComments = TRUE,allowCustomBorders = FALSE,customOpts = list())

解决方法

这是您想要的吗?

{{1}}

有关将Rhandsontable和闪亮的here结合在一起的更多信息。

,

这是解决方案,感谢@DzimitryM在 https://github.com/jrowen/rhandsontable/issues/334

t <- rhandsontable(vt,comments = vttooltips)
t$x$contextMenu <- list()
t