首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >R闪亮的仪表板标题下拉按钮可用于滚动

R闪亮的仪表板标题下拉按钮可用于滚动
EN

Stack Overflow用户
提问于 2020-07-21 18:13:07
回答 1查看 127关注 0票数 0

在我闪亮的仪表板标题中的按钮应该很容易看到和按下。然而,目前在标题中弹出下拉按钮,人们必须滚动才能看到按钮。下面你会找到一个可重现的代码示例。

以下是有关我的会话的更多信息:

R版本3.6.3 (2020-02-29)平台: x86_64-w64-mingw32/x64 (64位)运行环境: Windows 10 x64 (build 18363) shinythemes_1.1.2 shinyWidgets_0.5.3 shinyBS_0.61

代码语言:javascript
复制
if (interactive()) {
library(shiny)
require(dplyr)
require(shinydashboard)
require(shinyWidgets)
library(shinythemes)
  # A dashboard header with 3 dropdown menus
  header <- dashboardHeader(
    title = "Dashboard Demo",
   tags$li(class = "dropdown",tags$br(),
                               dropdownButton(inputId = "mydropdown",label = "",# style="minimal",
                                              # label="Language",
                                              circle = FALSE,
                                              icon = icon("globe"),#,status = "primary", 
                                              badgeStatus = "success",
                                              
                                              prettyRadioButtons(inputId = "selected_language", label="",
                                                                 choiceNames = list(
                                                                   HTML("<font color='black'>Deutsch</font>"), 
                                                                   tags$span(style = "color:black", "English")
                                                                 ),
                                                                 choiceValues =  c( "de",  "en"), 
                                                                 # inline=TRUE,
                                                                 selected = "en"
                                              )
                                              
                                              )# useShinyalert(),  # Set up shinyalert #
                               
                               ,
                               block = TRUE) ,
    tags$li(class = "dropdown",introjsUI(),    tags$br(),actionBttn(inputId = "Help",
                                                                    # color = "primary",
                                                                    style = 
                                                                      "minimal",
                                                                    icon = icon("question", lib="font-awesome"),label ="Help", size="sm"),
            block = TRUE),tags$li( class = "dropdown",tags$br(),
                                   
                                   introBox(dropdownMenu(
                                     type = "notifications", 
                                     icon = icon("envelope", lib = "glyphicon"),
                                     badgeStatus = NULL,
                                     headerText = "App maintainer contact:",
                                     notificationItem("TestMailAdress", icon("envelope", lib = "glyphicon"))
                                   ), data.step=5, data.intro = "Any further questions? Contact us!")
            ))
    
  
  shinyApp(
    ui = dashboardPage(
      header,
      dashboardSidebar(),
      dashboardBody()
    ),
    server = function(input, output) { }
  )
}
# }
EN

回答 1

Stack Overflow用户

发布于 2020-07-22 15:30:41

非常感谢你的回答。我自己想出来的。引用header按钮的introBox把事情搞乱了。所以在没有帮助窗口的情况下,它是有效的。能让introBox正常工作还是很好的,但我猜它只是还没有得到支持……

代码语言:javascript
复制
if (interactive()) {
library(shiny)
require(dplyr)
require(shinydashboard)
require(shinyWidgets)
library(shinythemes)
  # A dashboard header with 3 dropdown menus
  header <- dashboardHeader(
    title = "Dashboard Demo",
   tags$li(class = "dropdown",tags$br(),
                               dropdownButton(inputId = "mydropdown",label = "",# style="minimal",
                                              # label="Language",
                                              circle = FALSE,
                                              icon = icon("globe"),#,status = "primary", 
                                              badgeStatus = "success",
                                              
                                              prettyRadioButtons(inputId = "selected_language", label="",
                                                                 choiceNames = list(
                                                                   HTML("<font color='black'>Deutsch</font>"), 
                                                                   tags$span(style = "color:black", "English")
                                                                 ),
                                                                 choiceValues =  c( "de",  "en"), 
                                                                 # inline=TRUE,
                                                                 selected = "en"
                                              )
                                              
                                              )# useShinyalert(),  # Set up shinyalert #
                               
                               ,
                               block = TRUE) ,
    tags$li(class = "dropdown",introjsUI(),    tags$br(),actionBttn(inputId = "Help",
                                                                    # color = "primary",
                                                                    style = 
                                                                      "minimal",
                                                                    icon = icon("question", lib="font-awesome"),label ="Help", size="sm"),
            block = TRUE),tags$li( class = "dropdown",tags$br(),
                                   
                                  dropdownMenu(
                                     type = "notifications", 
                                     icon = icon("envelope", lib = "glyphicon"),
                                     badgeStatus = NULL,
                                     headerText = "App maintainer contact:",
                                     notificationItem("TestMailAdress", icon("envelope", lib = "glyphicon"))
                                   )
            ))
    
  
  shinyApp(
    ui = dashboardPage(
      header,
      dashboardSidebar(),
      dashboardBody()
    ),
    server = function(input, output) { }
  )
}
# }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63012264

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档