Closed senthilcaesar closed 12 months ago
I have set the reset to trigger whenever I perform an upload data action. reset = reactive(input$upload) But the data still remains
Hello,
Reset will only work if trigger_return = "change"
, this is the mode where you have control over the data by using your own validate / reset button.
Example :
library(shiny)
library(datamods)
ui <- fluidPage(
tags$h3("Import data with copy & paste"),
fluidRow(
column(
width = 4,
import_copypaste_ui("myid")
),
column(
width = 8,
actionButton("reset", "Reset data"),
tags$b("Data:"),
verbatimTextOutput(outputId = "data")
)
)
)
server <- function(input, output, session) {
imported <- import_copypaste_server("myid", trigger_return = "change", reset = reactive(input$reset))
output$data <- renderPrint({
imported$data()
})
}
shinyApp(ui, server)
Victor
Thank you so much @pvictor . In the future release, do you expect to apply the same behavior to trigger_return = "button"
https://github.com/dreamRs/datamods/blob/50eb6e5b2bdc25e6009aff13f0c0bdfd3ed9ecbc/R/import-copypaste.R#L99