Description Usage Arguments Value Note Author(s) Examples
View source: R/initital_state.R
Hidden only hides elements on the top level, so showing these elements will also show all children of them.
Disabled will recursively traverse the given elements and its children and set all inputs, buttons, selects and textfields to be disabled.
1 2 3 |
... |
tags to add to the ui, can be a single element or nested tagLists |
tags with the state change
If you have trouble with these functions, please make sure that you
either - use any dqshiny element in your UI - load the package with
library
- use init
at the beginning of your UI!
richard.kunze
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
init(),
actionButton("btn1", "Toggle Display"),
actionButton("btn2", "Toggle State"),
(disabled(actionButton("btn3", "Hello")))
),
server = function(input, output) {
observeEvent(input$btn1, toggle("btn3"))
observeEvent(input$btn2, toggle_state("btn3"))
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.