| deactivateItems | R Documentation |
Greys out inputs so they can't be used, or makes them usable again. Use this in the server to stop users clicking a button or download before the app is ready for it, for example deactivating every download at start and activating each one once there is something to download.
deactivateItems(itemIDs)
activateItems(itemIDs)
itemIDs |
IDs of the inputs to switch, as a character vector. |
Needs shinyjs::useShinyjs() in the UI, which UINav() adds for you.
NULL, invisibly. Called for its effect on the page.
if (interactive()) {
shiny::shinyApp(
ui = UINav(
appName = "Demo",
singleTab("Home",
navCheckbox("ready", "Ready to download?"),
navDownload("theDownload", "Download")
)
),
server = function(input, output, session) {
shiny::observe({
if (isTRUE(input$ready)) {
activateItems("theDownload")
} else {
deactivateItems("theDownload")
}
})
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.