相关疑难解决方法(0)

使用条件面板在闪亮的仪表板中添加动态选项卡

我想为我闪亮的应用程序提供动态标签.我尝试了下面的代码

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    checkboxGroupInput("Tabs", 
                       label = h4("tabpanel"), 
                       choices = list("tabs" = "tabs"),
                       selected = NULL),
    checkboxGroupInput("moreTabs", 
                       label = h4("moretabpanel"), 
                       choices = list("moretabs" = "moretabs"),
                       selected = NULL)
  ),
  dashboardBody(
    conditionalPanel(
      condition = "input.Tabs == 'tabs'",
      tabBox(
        title = "intro",
        id= "ttabs", width = 8, height = "420px",
        tabPanel("Files", dataTableOutput("Files")),
        conditionalPanel(
          condition = "input.moreTabs == 'moretabs'",
          tabPanel("Files1", dataTableOutput("Files1"))
        )
  )
)
)
)
server <- function(input, output) { }

shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)

但是,我没有成功动态使用选项卡面板.它只显示一个选项卡,在检查时,它应该显示第二个选项卡.

r shiny shinydashboard

5
推荐指数
1
解决办法
7742
查看次数

标签 统计

r ×1

shiny ×1

shinydashboard ×1