[R] shiny datatables column filtering plugin

Charles Determan Jr deter088 at umn.edu
Wed Sep 3 14:12:21 CEST 2014


Thank you for checking Yihui, on the off chance are you familiar with any
other methods to filter on multiple conditions?


On Tue, Sep 2, 2014 at 11:07 PM, Yihui Xie <xie at yihui.name> wrote:

> I just tested it and this plugin does not seem to work with the new
> .DataTable() API in DataTables 1.10.x, so I guess it is unlikely to
> make it work in (the current development version of) shiny. It is not
> in the official list of plugins, either:
> http://www.datatables.net/extensions/index
>
> Regards,
> Yihui
> --
> Yihui Xie <xieyihui at gmail.com>
> Web: http://yihui.name
>
>
> On Tue, Sep 2, 2014 at 11:59 AM, Charles Determan Jr <deter088 at umn.edu>
> wrote:
> > Greetings,
> >
> > I am currently exploring some capabilities of the 'Shiny' package.  I am
> > currently working with the most recent version of 'shiny' from the
> rstudio
> > github repository (version - 0.10.1.9006) in order to use the most up to
> > date datatables plugin.  Using the ggplot2 diamonds dataset, I can easily
> > set columns as unsearchable (commented out below) and I could also subset
> > out all the 'Ideal' diamonds for example, however I cannot filter out
> > multiple conditions such as 'Ideal' and 'Fair' diamonds together.  From
> my
> > searching, this multiple filtering can be done with checkboxes from the
> > column using the jquery column filtering plugin (
> >
> http://jquery-datatables-column-filter.googlecode.com/svn/trunk/checkbox.html
> ).
> > Despite this, I cannot get this plugin to work with my shiny app.  Any
> > insight would be appreciated.
> >
> > library(shiny)
> > library(ggplot2)
> > runApp(
> >   list(ui = basicPage(
> >     h1('Diamonds DataTable with TableTools'),
> >
> >     # added column filter plugin
> >     singleton(tags$head(tags$script(src='
> https://code.google.com/p/jquery-datatables-column-filter/source/browse/trunk/media/js/jquery.dataTables.columnFilter.js
> ',
> > type='text/javascript'))),
> >     dataTableOutput("mytable")
> >   )
> >   ,server = function(input, output) {
> >     output$mytable = renderDataTable({
> >       diamonds[,1:6]
> >     }, options = list(
> >       pageLength = 10,#       columnDefs = I('[{"targets": [0,1],
> > "searchable": false}]')
> >       columnFilter = I('[{
> >                         columnDefs: ["targets": [0,1], type: "checkbox"]
> >                         }]')
> >
> >     )
> >     )
> >   }
> >   ))
> >
> >
> >
> > Charles
>


Charles

	[[alternative HTML version deleted]]



More information about the R-help mailing list