【问题标题】:picketInput change placeholder R Shiny WidgetsPicketInput 更改占位符 R Shiny Widgets
【发布时间】:2020-01-14 02:15:52
【问题描述】:

来自shinyWidgets 包的pickerInput 有一个占位符标题Nothing selected

例如,如何用Pick a choice 替换它?我更喜欢使用 css 或pickerInput 选项的解决方案,如果可能的话,避免使用shinyjs

library(shiny)
library(shinyWidgets)

ui <- fluidPage(

  tags$head(
    tags$style(HTML("

    "))
  ),

  pickerInput(
    inputId = "mtcInputIndicateur", 
    label = "Select values", 
    choices = paste("choice", 1:10),
    options = list(`live-search` = TRUE),
    multiple = TRUE
  )
)



server <- function(input, output){
}

shinyApp(ui, server)

任何帮助将不胜感激。

【问题讨论】:

    标签: css r shiny placeholder shinywidgets


    【解决方案1】:

    刚刚找到答案,使用options中的参数title

    library(shiny)
    library(shinyWidgets)
    
    ui <- fluidPage(
    
      pickerInput(
        inputId = "mtcInputIndicateur", 
        label = "Select values", 
        choices = paste("choice", 1:10),
        options = list(`live-search` = TRUE, title = "Pick a choice"),
        multiple = TRUE
      )
    )
    
    
    
    server <- function(input, output){
    }
    
    shinyApp(ui, server)
    

    【讨论】:

      猜你喜欢
      • 2020-10-19
      • 1970-01-01
      • 2018-07-10
      • 2021-11-14
      • 2012-08-03
      • 2014-01-07
      • 2012-04-01
      • 2014-04-02
      • 2011-07-11
      相关资源
      最近更新 更多