【问题标题】:Use filters and buttons with dtedit in R shiny在 R Shiny 中使用带有 dtedit 的过滤器和按钮
【发布时间】:2020-11-21 22:36:33
【问题描述】:

我正在尝试在 R-shiny 中使用 Dtedit 库(我对此非常陌生)。 我试图找到一些方法来使用带有 dtedit 函数的过滤器(如 DT::datatable 中的 'filter="top"' ),但没有成功.. 此外,当我尝试使用“Datatables options - buttons”代码添加复制、CSV、PDF 和 Excel 按钮时,我收到以下错误:

    Warning: Error in dtedit: unused argument (datatable.call = function(...) {
DT::datatable(..., extensions = "Buttons")
})
50: server [#3]
Error in dtedit(input, output, name = "Grocery_List", thedata = data.frame(Buy = c("Tea", :
unused argument (datatable.call = function(...) {
DT::datatable(..., extensions = "Buttons")
})

我正在使用最新版本的 dtedit 和 shiny 软件包。

任何帮助都很重要! 非常感谢您的宝贵时间!

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    嗯,似乎有一个允许所有这些功能(过滤器和导出按钮)的 DTedit 发布版本。

    我是这样安装的:

    devtools::install_github('DavidPatShuiFong/DTedit@2.2.0')
    

    您可以在此处查看相关的 github 页面,其中包含大量示例:https://github.com/DavidPatShuiFong/DTedit

    现在相关RPubs vignette 中的示例闪亮应用程序也正在运行。

    为了同时允许过滤器和按钮,我只需在服务器的 dtedit() 中添加这个参数:

    datatable.call = function(...)
             {DT::datatable(..., extensions = 'Buttons', filter="top")},
             datatable.options = list(
               dom = 'Bfrtip',
               buttons = c('copy', 'csv', 'pdf', 'excel')
    )
    

    希望对您有所帮助!

    【讨论】:

      猜你喜欢
      • 2022-11-08
      • 2015-11-26
      • 2019-10-18
      • 1970-01-01
      • 1970-01-01
      • 2019-10-28
      • 2020-09-23
      • 2020-08-14
      • 1970-01-01
      相关资源
      最近更新 更多