Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 数据表-重置过滤器_R_Datatable_Shiny_Dt - Fatal编程技术网

R 数据表-重置过滤器

R 数据表-重置过滤器,r,datatable,shiny,dt,R,Datatable,Shiny,Dt,可能很容易,但不知何故无法完成,在有光泽的DT中重置过滤器的最佳方法是什么?我有一个非常宽的表,我不希望有人做一些过滤忘记他们过滤了屏幕宽度以外的另一列-我宁愿有一个按钮来清除所有过滤器。更改dom/打开/关闭过滤器是唯一的方法吗?抱歉,如果它是重复的-我检查了存档文件,无法看到它 虚拟应用程序来讨论它 library("shiny") library("DT") data(iris) shinyApp( ui = fluidPage( DT::dataTableOutput("tabel

可能很容易,但不知何故无法完成,在有光泽的DT中重置过滤器的最佳方法是什么?我有一个非常宽的表,我不希望有人做一些过滤忘记他们过滤了屏幕宽度以外的另一列-我宁愿有一个按钮来清除所有过滤器。更改dom/打开/关闭过滤器是唯一的方法吗?抱歉,如果它是重复的-我检查了存档文件,无法看到它

虚拟应用程序来讨论它

library("shiny")
library("DT")
data(iris)

shinyApp(
  ui = fluidPage( DT::dataTableOutput("tabel")
  ),
  server = function(input,output,session){
      output$tabel <- DT::renderDataTable({datatable(iris, filter="top")})
  }
)
库(“闪亮”)
图书馆(“DT”)
数据(iris)
shinyApp(
ui=fluidPage(DT::dataTableOutput(“tabel”)
),
服务器=功能(输入、输出、会话){

输出$tabel好的,答案不是太难, 设置代理

proxy <-dataTableProxy('tabel')
如果过滤器定义中的CLEAR=TRUE,它仍然会在搜索字段中保留讨厌的x,但在不重新加载内容的情况下清除过滤器并刷新内容(从2015年起)表明DT本身不支持重置,建议的解决方法是重新呈现整张表(对于使用大表的用户来说,可能不是一个好的解决方案).我不知道最近有没有做过什么。
clearSearch(proxy)