背景
shinyWidget::dropdownButton
在一个
shinydashboard::box
box(..., collapsible = TRUE)
.
HTML
我自己。
css
,因为下拉列表中的元素部分是白底白字(我想这是有道理的,因为他们是班级的(大)孩子)
.box-tools
)
我想要什么
目标:
现状:
标题中的下拉列表
我怎样才能做到这一点?哪个
css格式
css格式
代码
library(shiny)
library(shinydashboard)
library(shinyWidgets)
library(shinyjs)
makeDropDown <- function(i) {
dropdownButton(
h3("Heading"),
selectInput(paste0("sel", i), "Select:", LETTERS),
downloadButton(paste0("down", i), "Load"),
circle = FALSE,
icon = icon("cog")
)
}
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
useShinyjs(),
box(solidHeader = TRUE,
status = "info",
title = "Box",
div(
makeDropDown(1),
class = "box-tools pull-right",
id = "moveme"
),
makeDropDown(2)
)
)
)
server <- function(input, output, session) {
runjs("$('.box-header').append($('#moveme').detach())")
}
shinyApp(ui, server)