default_disabled: add disabled tag to an HTML element.

Description Usage Arguments Examples

View source: R/ability.R

Description

The function is to be used to disable an element when created.

Usage

1

Arguments

x

html element

Examples

 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
library(shinytools)

if (interactive()) {
  options(device.ask.default = FALSE)

  ui <- fluidPage(
    titlePanel("Hello dghiesse!"),
    load_jstools(),
    sidebarLayout(
      sidebarPanel(
        default_disabled(actionButton("dosomething", "don't click"))
      ),
      mainPanel(
        plotOutput("distPlot")
      )
    )
  )

  server <- function(input, output) {
    output$distPlot <- renderPlot({
      hist(rnorm(50))
    })
  }

  print(shinyApp(ui, server))
}

ardata-fr/shinytools documentation built on Nov. 15, 2019, 7:53 p.m.