aoColumns renderDatatable

324 views
Skip to first unread message

borja Varela

unread,
Jan 29, 2014, 2:26:37 PM1/29/14
to shiny-...@googlegroups.com
Hi, I want to delete the filtering box in each column. I put the next options in the renderDatatable function but it seems don't work. Any help?

renderDataTable({
      if (is.null(values$qm))
            stop(values$error)
      isolate({
            toDatatable(values$qm)
      })
}, options=list(bJQueryUI=TRUE, sDom='<"modelTitle" H>rt', bFilter=0, bSort=0, aoColumns=list(list(bSearchable=0), list(bSearchable=0), list(bSearchable=0), list(bSearchable=0),list(bSearchable=0), list(bSearchable=0))))

I find a way to delete all, by setting the css display option of tfoot to "false" but in other datatables I only need to remove 1 or 2, not all filtering boxes.

Thanks for your help.

Yihui Xie

unread,
Feb 20, 2014, 7:31:52 PM2/20/14
to borja Varela, shiny-discuss
Hi,

I just implemented this in the development version of shiny:
https://github.com/rstudio/shiny Please test it if you can. Thanks!

# bFilter=0 or FALSE will turn off all the search boxes:

runApp(list(
ui = fluidPage(
dataTableOutput('tab1')
),
server = function(input, output) {
output$tab1 = renderDataTable(iris, options = list(bFilter=FALSE))
}
))

# and you can also selectively disable search boxes for individual columns

runApp(list(
ui = fluidPage(
dataTableOutput('tab1')
),
server = function(input, output) {
output$tab1 = renderDataTable(iris, options = list(aoColumns =
list(list(bSearchable=0), list(bSearchable=1), list(bSearchable=0),
list(bSearchable=0),list(bSearchable=1))))
}
))


Regards,
Yihui

borja Varela

unread,
Feb 20, 2014, 10:33:36 PM2/20/14
to shiny-...@googlegroups.com, borja Varela
Thans for your answer. I already find a solution. I made my own javascrit handler for the databases, and put some new options that I need too like a main title with celspans in the top of the datatable and mark the first column as row headers.

But really, thanks.
Borja

Bob Tao

unread,
Jan 22, 2016, 3:48:34 PM1/22/16
to Shiny - Web Framework for R, vishke...@gmail.com
Hi, YiHui,

the default renderDataTable has search box for each column enabled, but DT::renderDataTable DT::datatable turned it off. is there a single parameter to turn it on?

Thanks,

Bob

Yihui Xie

unread,
Jan 22, 2016, 5:46:42 PM1/22/16
to Bob Tao, Shiny - Web Framework for R
Please see Section "Column Filters": http://rstudio.github.io/DT/

Regards,
Yihui
> --
> You received this message because you are subscribed to the Google Groups
> "Shiny - Web Framework for R" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to shiny-discus...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/shiny-discuss/0e83af71-8c64-4808-8baa-cb5848b08ed4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages