相关疑难解决方法(0)

在 Shiny 应用程序中自定义 rhandsontable 颜色的正确方法

所以,我正在创建一个闪亮的应用程序,我想为使用 rhandsontable 生成的表中的一些行着色。

我正在关注这个非常好的教程:https : //jrowen.github.io/rhandsontable/

具体来说,我对这部分感兴趣:

library(rhandsontable)
DF = data.frame(val = 1:10, bool = TRUE, big = LETTERS[1:10],
                small = letters[1:10],
                dt = seq(from = Sys.Date(), by = "days", length.out = 10),
                stringsAsFactors = FALSE)

col_highlight = 2
row_highlight = c(5, 7)

rhandsontable(DF, col_highlight = col_highlight, 
              row_highlight = row_highlight,
              width = 550, height = 300) %>%
  hot_cols(renderer = "
    function(instance, td, row, col, prop, value, cellProperties) {
      Handsontable.TextCell.renderer.apply(this, arguments);

      tbl = this.HTMLWidgets.widgets[0]

      hcols = tbl.params.col_highlight
      hcols = hcols …
Run Code Online (Sandbox Code Playgroud)

r shiny rhandsontable

6
推荐指数
1
解决办法
2372
查看次数

标签 统计

r ×1

rhandsontable ×1

shiny ×1