【发布时间】:2020-07-27 16:42:30
【问题描述】:
我有一个自定义的selectizeInput,我使用 options 参数指定可用的选项(为了简单起见,示例中省略了自定义呈现和搜索)。现在我被困在设置选定值的简单任务上。根据文档,这应该可以使用 items 字段,但我正在努力寻找正确的设置方法。
library(shiny)
library(purrr)
choices <- purrr::transpose(list(x = letters[1:5],
y = LETTERS[1:5]))
ui <- fluidPage(
selectizeInput("select", 'Select', choices = "",
selected = "",
options = list(
valueField = 'x',
labelField = 'y',
items = choices[[1]],
options = choices
))
)
shinyApp(ui, function(input, output, session) {})
【问题讨论】:
-
这个的用例是什么?为什么不使用
selected?
标签: r shiny selectize.js