Description Usage Arguments Examples
View source: R/metro-update-inputs.R
Change the value of a checkbox input on the client
1 | updateMetroCheck(session, inputId, label = NULL, value = NULL)
|
session |
The session object passed to function given to the server. |
inputId |
The id of the input object. |
label |
The label to set for the input object. |
value |
The value to set for the input object. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | if (interactive()) {
library(shiny)
library(shinyMetroUi)
shiny::shinyApp(
ui = metroPage(
actionButton("go", "Update checkbox"),
metroCheck(inputId = "checkbox1", label = "Checkbox", labelSide = "right")
),
server = function(input, output, session) {
observeEvent(input$go, {
updateMetroCheck(session, inputId = "checkbox1", value = TRUE)
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.