Rstudio brilliant selection string in DataTables?

Is there anyway for the selection bar to work with dataTables in Shiny?

http://datatables.net/examples/api/select_row.html

This post in a brilliant discussion seems to indicate that this is not possible, but this is a rather old post:

https://groups.google.com/forum/#!topic/shiny-discuss/_zNZMR2gHn0

Does anyone have a working example in gist or elsewhere?

+4
source share
2 answers

The version you are using may be a bit old. Take a look at this: http://datatables.net/reference/api/row ()

+2
source

Try the following:

Function

.row() .

shinyServer(function(input, output) {
       output$table_data <- DT::renderDataTable({
                                datatable(df,
                                          escape = FALSE,
                                          callback = JS(
                                          'table.on("click.dt","tr",function() {
                                               var data1 =table.row(this).data();
                                               console.log(data1);
                                         })'
                                       ))
                                  })
})
+1

Source: https://habr.com/ru/post/1548171/


All Articles