hidden: Sets the initial state of all given tags

Description Usage Arguments Value Note Author(s) Examples

View source: R/initital_state.R

Description

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.

Usage

1
2
3

Arguments

...

tags to add to the ui, can be a single element or nested tagLists

Value

tags with the state change

Note

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!

Author(s)

richard.kunze

Examples

 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"),
    hidden(disabled(actionButton("btn3", "Hello")))
  ),
  server = function(input, output) {
    observeEvent(input$btn1, toggle("btn3"))
    observeEvent(input$btn2, toggle_state("btn3"))
  }
)

}

daqana/dqshiny documentation built on Sept. 1, 2020, 4:31 p.m.