[英]Rstudio shiny select row in DataTables?
反正有沒有選擇行在Shiny中使用dataTables?
http://datatables.net/examples/api/select_row.html
閃亮討論中的這篇文章似乎表明這是不可能的,但這是一個相當古老的帖子:
https://groups.google.com/forum/#!topic/shiny-discuss/_zNZMR2gHn0
任何人都有一個在gist或其他地方的工作示例?
也許你使用它的版本有點舊。 看看這個: http : //datatables.net/reference/api/row()
嘗試這個:
.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);
})'
))
})
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.