View source: R/glass_multiselect.R
| glassMultiSelectValue | R Documentation |
Convenience helper for extracting a multi-select widget's value and style
from Shiny's input object without using modules.
glassMultiSelectValue(input, inputId)
input |
Shiny |
inputId |
Input id used in |
A named list with two reactives:
selectedReactive character vector of selected values
styleReactive string for the active style
Other glass select widgets:
glassMultiSelect(),
glassMultiSelectServer(),
glassSelect(),
glassSelectServer(),
glassSelectValue(),
updateGlassMultiSelect(),
updateGlassSelect()
if (interactive()) {
library(shiny)
ui <- fluidPage(
useGlassTabs(),
glassMultiSelect("cats", c(A = "a", B = "b", C = "c"))
)
server <- function(input, output, session) {
ms <- glassMultiSelectValue(input, "cats")
observe({
message("Selected: ", paste(ms$selected(), collapse = ", "))
message("Style: ", ms$style())
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.