【发布时间】:2018-09-16 22:40:36
【问题描述】:
单击第一个数据表中的一行时,我正在尝试导航到 R Shiny 中的另一个数据表选项卡。 我在这里看到了类似的例子。 但是我无法使用它们,因为我将数据从数据库直接提取到数据表中。
Hyperlink from one DataTable to another in Shiny
你能指导我如何完成它吗?
output$TbTable <- DT::renderDataTable(datatable(sqlOutput(),style = 'bootstrap', class = 'table-striped table-hover table-condensed',
extensions = c("FixedColumns","Scroller"),
filter = 'top',
options = list(
# dom = 't',
# deferRender = TRUE,
searching = TRUE,
autoWidth = TRUE,
# scrollCollapse = TRUE,
rownames = FALSE,
scroller = TRUE,
scrollX = TRUE,
scrollY = "500px",
#fixedHeader = TRUE,
class = 'cell-border stripe',
fixedColumns = list(
leftColumns = 3,
heightMatch = 'none', escape = FALSE,
options = list(initComplete = JS(
'function(table) {
table.on("click.dt", "tr", function() {
Shiny.onInputChange("rows", table.row( this ).index());
tabs = $(".tabbable .nav.nav-tabs li a");
$(tabs[1]).click();
});
}'))
))))
你能帮我解决这个问题吗?
谢谢,
【问题讨论】:
-
在浏览器中打开应用,打开开发者工具/控制台并检查错误。
-
数据表错误:未使用的参数(initComplete = JS(callback = "function(table)..
标签: r datatable hyperlink shiny