updateMetroCheck: Change the value of a checkbox input on the client

Description Usage Arguments Examples

View source: R/metro-update-inputs.R

Description

Change the value of a checkbox input on the client

Usage

1
updateMetroCheck(session, inputId, label = NULL, value = NULL)

Arguments

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.

Examples

 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)
    })
  }
 )
}

RinteRface/shinyMetroUi documentation built on Dec. 31, 2019, 8:47 a.m.