相关疑难解决方法(0)

R 闪亮的 updateSelectizeInput 标签的自定义 HTML 标签

有没有办法将 HTML 标签(例如 h6)用于 updateSelectizeInput(适用于 selectInput,请参阅下面的代码)?在下面的代码中,只需在 updateSelectizeInput [object Object] 中使用 h6("Label") 即可显示为输出。

rm(list = ls())
library(shiny)



ui =fluidPage(
  selectizeInput('DropDownSelectize',choices=NULL,label=""),
  selectInput('DropDownSelect',choices = c("choice1","choice2","choice3"),
  label=h6("Label"))
 )

server = function(input, output, session) {

 observe({
   updateSelectizeInput(session, 
                     'DropDownSelectize',
                      label = h6("Label"),
                      choices = c("choice1","choice2","choice3"),
                      selected = "choice1",
                      server = TRUE)

 })


}
runApp(list(ui = ui, server = server))
Run Code Online (Sandbox Code Playgroud)

谢谢

shiny selectize.js

2
推荐指数
1
解决办法
1296
查看次数

标签 统计

selectize.js ×1

shiny ×1