resetTimer | R Documentation |
Simulates a button press for Reset
.
resetTimer(inputId)
inputId |
character: input slot |
nothing
# Example requires the use of a `shiny` app (See Vignette)
if (interactive()) {
library(shiny)
library(shinyDTC)
library(shinyjs)
ui <- fluidPage(
useShinyjs(),
timerUI("timer1"),
actionButton("reset", "Trigger Reset")
)
server <- function(input, output, session) {
timerServer("timer1")
observeEvent(input$reset, {
resetTimer("timer1")
})
}
shinyApp(ui, server)
}
## Not run:
# `resetTimer` must be used inside a `shiny` server function
# and requires `shinyjs` + a corresponding timer UI
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.