按顺序在tabBox中为给定的sidebarMenu启用tabPanel

时间:2017-08-18 12:37:42

标签: r shiny shinydashboard

如何为给定的菜单项顺序启用标签? 我有一个如下所述的侧边栏菜单,对于每个菜单栏,我在选项卡面板中有几个选项卡。假设我要启用标签"创建数据包"点击参数&中的goButton设置

    sidebarMenu(
        menuItem(
          "A",
          tabName = "CA",
          icon = icon("dashboard")
        ),
        menuItem(
          "B",
          icon = icon("th"),
          tabName = "PO",
          badgeLabel = "new",
          badgeColor = "green"
        )
      )

对于菜单项CA和PO,正文是

 body <- dashboardBody( 
        tabItems(tabItem(
      tabName = "CA",
        tabBox(selected = "Parameter and Setting",
          id = "tabset1",
          width = "1000px",
          height = "650px",
          tabPanel(
            "Parameter and Setting",
            column(
              6,
              selectInput("select1", "Select the portfolio definition for analysis", c(portfolioDef$portDef))
            ),
            column(
              6,
              dateInput("date6", "Select Reporting Date:", startview = "decade")
            ),
            fluidRow(
              column(
                6,
                align = "center",
                offset = 3,
                actionButton("goButton", "Create Data Package"),
                tags$style(
                  type = 'text/css',
                  "#button { vertical-align: middle; height: 50px; width: 100%; font-size: 30px;}"
                )
              )
            )
            ),
          tabPanel("Create Data Package",
                    div(style="display:inline-block; vertical-align:top; width: 250px;",
                     selectInput("varx", "Select categorical variables for X - axis", c(catVarX$VarX))
                   ),
                   div(style="display: inline-block;vertical-align:top; width: 500px;",HTML("<br>")),
                   div(style="display:inline-block; vertical-align:top; width: 250px;",
                     selectInput("vary", "Select categorical variables for Y - axis", c(catVarY$VarY))
                   ),
                   multicolLab,
                   fluidRow(    
                     column(width = 6, radioLab),
                     column(6)
                   )
                   )
            )
            ),
        tabItem(tabName = "PO", h2(
          "Widgets tab content"
        ))))

0 个答案:

没有答案