{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/shinydashboard/issues/25","labels_url":"https://api.github.com/repos/rstudio/shinydashboard/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shinydashboard/issues/25/comments","events_url":"https://api.github.com/repos/rstudio/shinydashboard/issues/25/events","html_url":"https://github.com/rstudio/shinydashboard/issues/25","id":64069387,"number":25,"title":"dashboardSidebar, selectInput nested under menuItem","user":{"login":"phillc73","id":815126,"avatar_url":"https://avatars.githubusercontent.com/u/815126?v=3","gravatar_id":"","url":"https://api.github.com/users/phillc73","html_url":"https://github.com/phillc73","followers_url":"https://api.github.com/users/phillc73/followers","following_url":"https://api.github.com/users/phillc73/following{/other_user}","gists_url":"https://api.github.com/users/phillc73/gists{/gist_id}","starred_url":"https://api.github.com/users/phillc73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillc73/subscriptions","organizations_url":"https://api.github.com/users/phillc73/orgs","repos_url":"https://api.github.com/users/phillc73/repos","events_url":"https://api.github.com/users/phillc73/events{/privacy}","received_events_url":"https://api.github.com/users/phillc73/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-24T18:38:59Z","updated_at":"2015-03-27T22:35:24Z","closed_at":"2015-03-27T19:24:42Z","body":"I'd like to display Shiny input fields as a type of menuSubItem, however I'm finding it difficult to write the solution.\r\n\r\nThe dashboard tutorial page suggests inputs in the sidebar are possible:\r\n\r\nhttp://rstudio.github.io/shinydashboard/structure.html#inputs-in-the-sidebar\r\n\r\nI have seen this example where a sliderInput is effectively it's own menuItem:\r\n\r\nhttps://github.com/rstudio/shiny-examples/blob/master/087-crandash/ui.R\r\n\r\nWhat I would really like to happen is that a menuItem is selected, which not only displays content in the dashboardBody, but also reveals additional input fields as menuSubItems. Using dashboard example code, I was hoping something like this would work:\r\n\r\n```R\r\nmenuItem(\"Widgets\", icon = icon(\"th\"), tabName = \"widgets\", badgeLabel = \"new\", badgeColor = \"green\",\r\n             selectInput(\"inputTest\", label = h5(\"Input Test\"), choices = c(\"a\", \"b\", \"c\", \"d\"), multiple=TRUE, selectize=TRUE, width = '95%')\r\n             )\r\n```\r\nExecuting the example code (https://gist.github.com/wch/8957ee5e2d79770abf9a) with the above edit to the Widgets menuItem does not result in any errors, but also clicking the Widgets menuItem does not reveal a selectInput field.\r\n\r\nI can't find any examples of this type structure elsewhere. Is it possible to do this? \r\n"},"comment":{"url":"https://api.github.com/repos/rstudio/shinydashboard/issues/comments/87109265","html_url":"https://github.com/rstudio/shinydashboard/issues/25#issuecomment-87109265","issue_url":"https://api.github.com/repos/rstudio/shinydashboard/issues/25","id":87109265,"user":{"login":"phillc73","id":815126,"avatar_url":"https://avatars.githubusercontent.com/u/815126?v=3","gravatar_id":"","url":"https://api.github.com/users/phillc73","html_url":"https://github.com/phillc73","followers_url":"https://api.github.com/users/phillc73/followers","following_url":"https://api.github.com/users/phillc73/following{/other_user}","gists_url":"https://api.github.com/users/phillc73/gists{/gist_id}","starred_url":"https://api.github.com/users/phillc73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillc73/subscriptions","organizations_url":"https://api.github.com/users/phillc73/orgs","repos_url":"https://api.github.com/users/phillc73/repos","events_url":"https://api.github.com/users/phillc73/events{/privacy}","received_events_url":"https://api.github.com/users/phillc73/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T22:35:24Z","updated_at":"2015-03-27T22:35:24Z","body":"Thanks Winston.\r\n\r\nThe inputs now appear as described in the various menus. However, unexpected behaviour is that content in dashboardBody() no longer displays.\r\n\r\n**Examples**\r\n\r\nThis displays the box in dashboardBody() correctly:\r\n\r\n```R\r\nlibrary(\"shinydashboard\")\r\n\r\nheader <- dashboardHeader()\r\n\r\nsidebar <- dashboardSidebar(\r\n  sidebarMenu(\r\n    menuItem(\"Inputs\", icon = icon(\"bar-chart-o\"), tabName = \"tabOne\"\r\n    )\r\n  )\r\n)\r\n\r\nbody <- dashboardBody(\r\n  tabItems(\r\n    tabItem(\"tabOne\",\r\n            box(title = \"Box One\", \r\n                width = 12,\r\n                height = \"500px\",\r\n                status = \"success\", \r\n                solidHeader = TRUE, \r\n                collapsible = TRUE,\r\n                verbatimTextOutput(\"boxOneText\")\r\n                )\r\n            )\r\n    )\r\n  )\r\n\r\nshinyApp(\r\n  ui = dashboardPage(header, sidebar, body),\r\n  server = function(input, output) {\r\n    \r\n    output$boxOneText <- renderText({\r\n      paste(\"A test designed to provoke an emotional response\")\r\n    })\r\n    \r\n  }\r\n)\r\n```\r\nHowever, the following code with correctly displaying inputs added as menu items, results in the dashboardBody() box disappearing.\r\n\r\n```R\r\nlibrary(\"shinydashboard\")\r\n\r\nheader <- dashboardHeader()\r\n\r\nsidebar <- dashboardSidebar(\r\n  sidebarMenu(\r\n    menuItem(\"Inputs\", icon = icon(\"bar-chart-o\"), tabName = \"tabOne\",\r\n             # Input directly under menuItem\r\n             selectInput(\"inputTest\", \"Input Test\",\r\n                         choices = c(\"a\", \"b\", \"c\", \"d\"), multiple=TRUE, selectize=TRUE,\r\n                         width = '98%'),\r\n             \r\n             # Input inside of menuSubItem\r\n             menuSubItem(icon = NULL,\r\n                         sliderInput(\"inputTest2\", \"Input test 2\", min=0, max=10, value=5,\r\n                                     width = '95%')\r\n                         )\r\n             )\r\n    )\r\n)\r\n\r\nbody <- dashboardBody(\r\n  tabItems(\r\n    tabItem(\"tabOne\",\r\n            box(title = \"Box One\", \r\n                width = 12,\r\n                height = \"500px\",\r\n                status = \"success\", \r\n                solidHeader = TRUE, \r\n                collapsible = TRUE,\r\n                verbatimTextOutput(\"boxOneText\")\r\n                )\r\n            )\r\n    )\r\n  )\r\n\r\nshinyApp(\r\n  ui = dashboardPage(header, sidebar, body),\r\n  server = function(input, output) {\r\n    \r\n    output$boxOneText <- renderText({\r\n      paste(\"A test designed to provoke an emotional response\")\r\n    })\r\n    \r\n  }\r\n)"}}