【问题标题】:Add vertical scrollbar to shinyjs dropdownbutton - shiny将垂直滚动条添加到 shinyjs 下拉按钮 - 闪亮
【发布时间】:2018-10-27 07:52:25
【问题描述】:

我正在使用 shinyjs 下拉按钮在闪亮仪表板中显示单选按钮。 我需要你的帮助来解决以下问题,

为下拉菜单添加垂直滚动条。

请检查我的代码,

library(shiny)
library(shinydashboard)
library(shinyjs)

ui <- dashboardPage(skin = "black",
                    dashboardHeader(title = "test"), 
                    dashboardSidebar(),
                    dashboardBody(
                                fluidRow(
                                  column(width = 1),
                                  dropdownButton(
                                    tags$h3("List of Input"),
                                    radioButtons("attr_var","", c("1","2","3","4","5","6","7","8")),
                                    circle = TRUE, status = "danger", icon = icon("gear"), width = "100px",
                                    tooltip = tooltipOptions(title = "Click to see inputs")))))

server <- function(input, output, session) { }

shinyApp(ui, server)

提前致谢, SJB。

【问题讨论】:

    标签: css r shiny shinydashboard shinyjs


    【解决方案1】:

    这是一个相当晚的答案,但诀窍是在下拉按钮中设置 max-heightoverflow-y 值。您的代码可能如下所示:

    dropdownButton(
        circle = TRUE, status = "danger", icon = icon("gear"), width = "100px",
        tooltip = tooltipOptions(title = "Click to see inputs")))),
        div(style='max-height: 80vh; overflow-y: auto;',
        tags$h3("List of Input"),
        radioButtons("attr_var","", c("1","2","3","4","5","6","7","8"))))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-10
      • 2015-09-24
      • 2011-07-27
      • 2020-03-04
      • 1970-01-01
      • 2022-01-16
      • 2020-04-02
      • 1970-01-01
      相关资源
      最近更新 更多