问题:侧栏菜单中的menuItem充当下拉菜单,并且未引用相应的正文

问题描述

我是R的初学者,想问一下您是否可以帮助我解决以下问题:

我在sidebarMenu中创建了多个menueItems。在向每个输入添加了多个输入(如selectInput,daterangeInput ...)之后,它们充当了一个下拉菜单,并且没有引用各自的身体了。为了解决这个问题,我创建了一个额外的menuSubitem(它可以工作,但是我认为该解决方案不是很好)。

没有此额外的menuSubitem,正文内容将不会显示。如果我单击原始menuItem的图标,则仅打开下拉菜单显示主体的选择器和额外添加的menuSubitem),但未打开相应的主体本身。我还希望下拉列表激活引荐主体(这样我就不再需要menuSubitem了)。希望我的问题很清楚。

如果能帮助我,那将是很棒的:)

# 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",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: ",unique(as.character(sort(table_data$Federal_State_Registration)))),selectize = FALSE
                       )
                   
                   ),menuItem("Heatmap1",tabName = "About2",menuSubItem("Heatmap2",#extra button i want to avoid
              # Panel for user inputs ---
              # Input: Community ---
              selectInput("com_heat",unique(as.character(sort(data$Community_Registration)))),selectize = FALSE
              ),# Input: federal state ---
              selectInput("fed_heat",unique(as.character(sort(data$Federal_State_Registration)))),# Input: Select heatmap intensity ---
              sliderInput("max_heat","Heatmap Intensity: ",min = 1,max = 100,value = 100
              )
          
            ),...

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)