Skip to content
New issue

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

Can't use renderMenu with menuSubItems #54

Closed
Tutuchan opened this issue Jun 7, 2015 · 1 comment
Closed

Can't use renderMenu with menuSubItems #54

Tutuchan opened this issue Jun 7, 2015 · 1 comment

Comments

@Tutuchan
Copy link

Tutuchan commented Jun 7, 2015

Hi, I might be doing something wrong but I've spent a couple hours on this and I don't see where my error could be.

Here is a basic reproducible example. When I execute this code, the app correctly shows a menuItem that can be expanded to a menuSubItem.

library(shinydashboard)
sidebar <- dashboardSidebar(
  sidebarMenu(menuItem("foo",
                        menuSubItem("foo_"), tabName = "tabfoo"))
)


ui <- dashboardPage(
  dashboardHeader(),
  sidebar,
  dashboardBody()
)

server <- function(input, output) {}

shinyApp(ui, server)

However, when I try to do it dynamically with renderMenu :

library(shinydashboard)
library(shiny)

sidebar <- dashboardSidebar(
  sidebarMenuOutput("sbMenu")
)


ui <- dashboardPage(
  dashboardHeader(),
  sidebar,
  dashboardBody()
)

server <- function(input, output) {
  output$sbMenu <- renderMenu({
    sidebarMenu(menuItem("foo", menuSubItem("foo_"), tabName = "tabfoo"))
    })
}

shinyApp(ui, server)

I can see the menuItem and the arrow showing that a menuSubItem is present but it cannot be expanded. Any idea what might be causing this ?

@wch wch closed this as completed in 02dd45b Jun 16, 2015
@wch
Copy link
Contributor

wch commented Jun 16, 2015

Thanks for the report, I've just pushed a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants