css - 将垂直滚动条添加到 shinyjs 下拉按钮 - 闪亮
问题描述
我正在使用 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。
解决方案
这是一个相当晚的答案,但诀窍是在 dropdownButton中设置max-height
and值。overflow-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"))))
推荐阅读
- spring-integration - 如何使用 @InboundChannelAdapter 从两个不同的目录读取文件(Spring Integration with java configuration)
- c++ - 我使用 Stringstream 错了吗?
- loops - 全局宏和循环冲突
- if-statement - 检查条件后如何返回值?
- php - Laravel 5 和 Angular 6 路由问题
- c# - 部署 .NET Core 微服务
- typescript - TypeScript:类型化数组作为对象属性
- python - 图遍历,也许是另一种数学?
- r - 无法在 r 3.5.1 中加载吸墨纸
- python - 如何在python 3中将输出序列导出到excel表?