Is there anyway to have select row working with dataTables in Shiny?
http://datatables.net/examples/api/select_row.html
This post in shiny-discuss seems to indicate that it is not possible, but it's quite an old post:
https://groups.google.com/forum/#!topic/shiny-discuss/_zNZMR2gHn0
Anyone have a working example in gist or elsewhere?
Maybe the version you are using its a little old. Look at this: http://datatables.net/reference/api/row()
Try this:
.row() function makes it possible to get the data when a particular row is clicked.
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);
})'
))
})
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With