menuItems in sidebarmenu act as dropdown and are not referring to respective body.

Hello community,

I am a beginner to R and would like to ask you if you can help me to solve the following problem:

I created multiple menueItems within the sidebarMenu. After I added multiple inputs (like selectInput, dateRangeInput...) to each of them, they act as a dropdown and are not referring to the respective body anymore. To solve I created a extra menuSubitem.

Without this extra menuSubitem, the content of the body does not show up. If I click on the icon of the original menuItem it just opens the drop-down (showing the selectors for the body and the extra added menuSubitem), but it's not opening the respective body itself. I would like the dropdown also to activate the referring body (so that I don't need the menuSubitem any more). Hope my question is clear enough.

Would be great if you can help me :slight_smile:

# code chunk:
...
       sidebarMenu( 
          menuItem("Graph1", tabName = "About1", icon = icon("th"),
                       #without this extra menuSubitem, the content of the body does not show up. if i click on the icon above(Graph1) it just opens the drop down, but not opening the body.
                   menuSubItem("Graph2", tabName = "About1", icon = icon("th")),
                   # Input: Select a date range ---
                       dateRangeInput(
                         "dat",
                         "Date Range of Vehicle Registration: ",
                         start = "2009-01-01",
                         end = "2016-12-28",
                         min = "2009-01-01",
                         max = "2016-12-28",
                         format = "dd/mm/yyyy",
                         separator = "to",
                         startview = "year"
                       ),
                       
                       # Input: community ---
                       selectInput("com",
                                   "Community: ",
                                   c("ALL",
                                     unique(as.character(sort(table_data$Community_Registration)))),
                                   selectize = FALSE
                       ),
                       
                       # Input: federal state ---
                       selectInput("fed",
                                   "Federal State: ",
                                   c("ALL",
                                     unique(as.character(sort(table_data$Federal_State_Registration)))),
                                   selectize = FALSE
                       )
                   
                   ),
          
          menuItem("Heatmap1", tabName = "About2", icon = icon("th"),
              menuSubItem("Heatmap2", tabName = "About2", icon = icon("th")),   #extra button i want to avoid
              # Panel for user inputs ---
              # Input: Community ---
              selectInput("com_heat",
                          "Community: ",
                          c("ALL",
                            unique(as.character(sort(data$Community_Registration)))),
                          selectize = FALSE
              ),
              
              # Input: federal state ---
              selectInput("fed_heat",
                          "Federal State: ",
                          c("ALL",
                            unique(as.character(sort(data$Federal_State_Registration)))),
                          selectize = FALSE
              ),
              
              # Input: Select heatmap intensity ---
              sliderInput("max_heat",
                          "Heatmap Intensity: ",
                          min = 1,
                          max = 100,
                          value = 100
              )
          
            ),
          
          #to be continued
          menuItem("diagram how often the parts failed or failure was detected on engine", tabName = "About3", icon = icon("th")),
          menuItem("basic dataset", tabName = "About4", icon = icon("th"))
        )

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.