Description Usage Arguments Note Author(s) See Also Examples
Those functions can be used to change an elements visibility status.
1 2 3 4 5 |
ids |
Character vector, id(s) of the element to hide/show. |
condition |
Condition to be used for toggling the visibility (TRUE = visible), can be of length one or length of ids. |
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
Other js handler:
add_class()
,
enable()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
init(),
actionButton("hide", "Hide"),
actionButton("show", "Show"),
actionButton("toggle", "Toggle"),
actionButton("toggle_cond", "Toggle Visibility with Condition"),
actionButton("toggle_all", "Toggle All Visibilities"),
checkboxInput("condition", "Visible"),
actionButton("example1", "EXAMPLE1"),
actionButton("example2", "EXAMPLE2"),
actionButton("example3", "EXAMPLE3")
),
server = function(input, output) {
observeEvent(input$hide, hide("example1"))
observeEvent(input$show, show("example1"))
observeEvent(input$toggle, toggle("example1"))
observeEvent(input$toggle_cond,
toggle("example1", input$condition)
)
observeEvent(input$toggle_all,
toggle(c("example1", "example2", "example3"))
)
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.