We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This comes up when you want to include a conditional.
For example
library(shiny) library(shinydashboard) show_tab_2 <- FALSE ui <- dashboardPage( dashboardHeader(), dashboardSidebar( sidebarMenu( menuItem("tab1", tabName = "tab1"), if (show_tab_2) menuItem("tab2", tabName = "tab2") ) ), dashboardBody( tabItems( tabItem("tab1", "tab1"), if (show_tab_2) tabItem("tab2", "tab2") ) ) ) server <- function(input, output) {} shinyApp(ui, server)
This results in an error since the if statement results in a NULL ui item. It would be useful if shinydashboard knew to just ignore NULL items
NULL
The text was updated successfully, but these errors were encountered:
The problems seems to be with the tabItems() rather than sidebarMenu()
tabItems()
sidebarMenu()
Sorry, something went wrong.
This would be useful!
For those interested in a workaround:
library(shiny) library(shinydashboard) show_tab_2 <- FALSE ui <- dashboardPage( dashboardHeader(), dashboardSidebar( sidebarMenu( menuItem("tab1", tabName = "tab1"), if (show_tab_2){menuItem("tab2", tabName = "tab2")} ) ), dashboardBody( tabItems( tabItem("tab1", "tab1"), if (show_tab_2){tabItem("tab2", "tab2")} else { div(class = 'tab-pane') } ) ) ) server <- function(input, output) {} shinyApp(ui, server)
No branches or pull requests
This comes up when you want to include a conditional.
For example
This results in an error since the if statement results in a
NULL
ui item. It would be useful if shinydashboard knew to just ignore NULL itemsThe text was updated successfully, but these errors were encountered: