updateTimerInput {shinyDTC}R Documentation

updateTimerInput

Description

updateTimerInput

Usage

updateTimerInput(
  session = getDefaultReactiveDomain(),
  inputId,
  step1 = list(),
  reset = list(),
  ...
)

Arguments

session

session object

inputId

id of the input object

step1

modified values for Step button, see shiny::updateActionButton()

reset

modified values for Reset button, see shiny::updateActionButton()

...

modified values for Speed slider, see shiny::updateSliderInput()

Value

nothing

Examples

# Example requires the use of a `shiny` app (See Vignette)
# Updates the timer UI in a `shiny` app
if (interactive()) {
  library(shiny)
  library(shinyDTC)

  ui <- fluidPage(
    timerUI("timer1"),
    actionButton("update", "Update Timer UI")
  )

  server <- function(input, output, session) {
    timerServer("timer1")

    observeEvent(input$update, {
      updateTimerInput(
        session, "timer1",
        step1 = list(label = "Advance"),
        reset = list(label = "Clear"),
        min = 0, max = 100, value = 10
      )
    })
  }

  shinyApp(ui, server)
}

[Package shinyDTC version 0.1.0 Index]