我面临两个问题。任何帮助将不胜感激,因为我是一个完整的新手建立闪亮的仪表板。 1)无法将单个列搜索到我的第一个表中,因为该表具有> 18000行。 2)我创建的侧边栏条件面板为每个选项卡工作,因为它们独立显示每个选项卡的列名称,但无法单独连接到选项卡。我认为这可能是来自“DT”和闪亮的仪表板包的干扰?
library(shinydashboard)
library(shinyjs)
library(shiny)
library(DT)
library(markdown)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
headerPanel(),
conditionalPanel(
"$('li.active a').first().html()==='Results'",
checkboxGroupInput('show_vars',
'Columns in Results to show:',
names(Results),
selected = names(Results)),
actionButton("Results","Submit")),
conditionalPanel(
"$('li.active a').first().html()==='Processed'",
checkboxGroupInput('show_vars',
'Columns in Processed to show:',
names(Processed),
selected = names(Processed)),
actionButton("processed","Submit")),
conditionalPanel(
"$('li.active a').first().html()==='Request'",
checkboxGroupInput('show_vars',
'Columns in Request to show:',
names(Request),
selected = names(Request)),
actionButton("Request","submit"))
),
dashboardBody(tabsetPanel(
tabPanel('Results',
DT::dataTableOutput("mytable1")),
tabPanel('Processed',
DT::dataTableOutput ("mytable2")),
tabPanel('Request',
DT::dataTableOutput ("mytable3")),
)
)
)
))
server <- function(input, output) {
output$mytable1 = renderDataTable({
DT::datatable(Results, options = list(scrollX = TRUE))
})
output$mytable2 = DT::renderDataTable({
DT::datatable(Processed, options = list(scrollX = TRUE),
filter="bottom", selection="multiple", escape = FALSE)
})
output$mytable3 = renderDataTable({
DT::datatable(Request, filter="bottom", selection="multiple", escape = FALSE,
options = list(scrollX = TRUE))
})
}