有没有一种方法可以使用Shiny更新的DT :: renderDataTable和DT :: dataTableOutput按列进行搜索? [英] Is there a way to search by column with Shiny's updated DT::renderDataTable and DT::dataTableOutput?

查看:184
本文介绍了有没有一种方法可以使用Shiny更新的DT :: renderDataTable和DT :: dataTableOutput按列进行搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Shiny似乎已更改了数据表的实现。是什么原因呢?

Shiny seems to have changed the implementation of data tables. What was the reason for this?

除非我遗漏了一些东西,否则新的默认设置看起来像是倒退了一步。一方面,他们缺少表格底部特定于列的搜索框。有没有办法替换该功能?

Unless I'm missing something, the new default looks like a step backwards. For one thing, they are missing the column-specific search boxes at the bottom of the table. Is there a way to replace that functionality?

推荐答案

它肯定仍然存在,似乎不再是默认值。 / p>

It certainly still exists, it just seems to not be the default anymore.

library(shiny)
runApp(shinyApp(
  ui = fluidPage(
    DT::dataTableOutput("table")
  ),
  server = function(input, output, session) {
    output$table <- DT::renderDataTable(cars, filter = "top")
  }
))

我只是去了网站docs以获取数据表 https://rstudio.github.io/DT/ ,并在首页上说明如何使用 filter 参数

I just went to the website docs for datatable at https://rstudio.github.io/DT/ and on the front page they say how to use the filter parameter

确保您使用的是Shiny和DT的最新版本(使用GitHub版本,因为在过去2周中做了很多工作)

Make sure you're using the most up to date version of both shiny and DT (use the GitHub version because a lot of work was done in the past 2 weeks)

这篇关于有没有一种方法可以使用Shiny更新的DT :: renderDataTable和DT :: dataTableOutput按列进行搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆