Skip to content

Instantly share code, notes, and snippets.

library(shiny)
library(shinyjs)
mod1UI = function(id){
ns = NS(id)
fluidRow(
shinyjs::useShinyjs(),
actionButton('show', 'Show'),
actionButton('hide', 'Hide'),
@geebioso
geebioso / gist:8f6e18a54e983105c073ebda850227a5
Created June 21, 2019 03:42
Delete and auto-populate rows
library(shiny)
library(shinyjs)
library(glue)
ui <- fluidPage(
actionButton('delete_all', label = "Delete All"),
actionButton('auto_populate', label = "Auto Populate"),
tagList(
shinyalert::useShinyalert(),
@geebioso
geebioso / accordion_reprex
Last active June 20, 2019 19:59
This code creates deletable dynamic accordions that load a modal when they are created. The modal is triggering too many times after an accordion is deleted and then reloaded.
makeReactiveTrigger <- function() {
rv <- shiny::reactiveValues(a = 0)
list(
depend = function() {
rv$a
},
trigger = function() {
rv$a <- shiny::isolate(rv$a + 1)
}
)