Description Usage Arguments Value Author(s) Examples
View source: R/reset_slider_input.R
Function to send a message to js to reset an existing slider input. Use it ro restore a slider input's initial values.
1 |
id |
id of the slider input to reset |
sent message
richard.kunze
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
init(),
sliderInput("mySlider", "Change me", 0, 200, c(90, 117)),
actionButton("btn1", "Reset slider")
),
server = function(input, output) {
observeEvent(input$btn1, reset_slider_input("mySlider"))
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.