Shinydashboard 'subMenuItem' not dynamic

1,467 views
Skip to first unread message

Hoyt Emerson

unread,
Jan 29, 2015, 4:32:54 PM1/29/15
to shiny-...@googlegroups.com

Hello,

I'm building a dashboard using shinydashboard and am noticing an issue.
The 'subMenuItem' tabs on the sideBar are not dynamic. Notice the screenshot below. They are not hidden. I should be able to click on the 'Some Cool Stuff' tab and hide the sub menus. But this functionality isn't happening.

Has anyone else noticed this?

I'm assuming the necessary js files are in the shinydashboard package.













dashboardSidebar(
    sidebarMenu(
      menuItem("Some Cool Stuff", icon = icon("th")), 
        menuSubItem("Sub-item 1", tabName = "subitem1"),
        menuSubItem("Sub-item 2", tabName = "subitem2"),
      )
    ),


 dashboardBody(
    tabItems( 

#Tab Content
      tabItem("subitem1",
              "Sub-item 1 tab content"
      ),
      tabItem(tabName="forms", "subitem2",
              "Sub-item 2 tab content"
      ),

Winston Chang

unread,
Jan 29, 2015, 5:34:51 PM1/29/15
to Hoyt Emerson, shiny-discuss
I think the problem is that you have an extra closing paren in this line:
  menuItem("Some Cool Stuff", icon = icon("th")),

-Winston


--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/dc001138-ea6d-4881-97fe-b323d8a370e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hoyt Emerson

unread,
Jan 29, 2015, 6:12:10 PM1/29/15
to Winston Chang, shiny-discuss
Winston thank you for that. It wasn't that I had an extra paren, but that I needed to move it down after the subMenuItems. So, subMenuItems need to be nested within the menuItem function.

Thanks so much.

Hoyt
--
Hoyt Emerson
503-616-8221


Reply all
Reply to author
Forward
0 new messages