I have a question about conditional panel in shiny dashboard. Is there a possibility to make conditional panel with condition on menuItem
in sidebarMenu>
Adding an extra argument id
to sidebarMenu
solves the problem.
ui <- dashboardPage(
dashboardHeader(title = "Basic Dashboard"),
dashboardSidebar(
sidebarMenu(id="menu1",
menuItem("tab title1", tabName = "name1", icon = icon("th")),
menuItem("tab title2", tabName = "name2", icon = icon("th"))
),
conditionalPanel(
condition = "input.menu1 == 'name2'",
selectInput("period", "Period:",
choices = list("Years" = 1, "Months" = 2))
)
),
dashboardBody())