Html 如何在Shiny中动态设置pickerInput菜单的样式
我想根据下例中Html 如何在Shiny中动态设置pickerInput菜单的样式,html,css,r,shiny,Html,Css,R,Shiny,我想根据下例中colorInput的输入更新我的pickerInput的颜色 这些问题是从pickerInput而不是selectizeInput复制而来的 这在selectizeInput中非常有效: ##加载虹膜数据集 数据(iris) 猫CSS我永远也不会明白这一点。谢谢,谢谢你再次前来救援! CSS <- function(colors){ template <- " .dropdown-menu ul li:nth-child(%s) a { backgr
colorInput
的输入更新我的pickerInput
的颜色
这些问题是从pickerInput
而不是selectizeInput
复制而来的
这在selectizeInput
中非常有效:
##加载虹膜数据集
数据(iris)
猫CSS我永远也不会明白这一点。谢谢,谢谢你再次前来救援!
CSS <- function(colors){
template <- "
.dropdown-menu ul li:nth-child(%s) a {
background: %s !important;
color: white !important;
}"
paste0(
apply(cbind(seq_along(colors), colors), 1, function(vc){
sprintf(template, vc[1], vc[2])
}),
collapse = "\n"
)
}
output$css <- renderUI({
tags$style(HTML(CSS(cols_user())))
})