2021年5月2日星期日

R Shiny Reactable - Selection option to update checkboxes using updateReactable doesnt work inside Modal

Selection option to update checkboxes using updateReactable doesnt work inside Modal. However, when I leave the modal and enter again it works.

Below is the reproducible code:

library(shiny)  library(reactable)    ui <- fluidPage(  actionButton("bt", "Load Modal")    )    server <- function(input, output, session) {    output$table <- renderReactable({  reactable(iris, selection = "multiple")  })    observeEvent(input$bt,{    showModal(    modalDialog(tags$head(tags$style(".modal-dialog{ width:1500px}")),                fluidRow(                  titlePanel("reactable example"),                  reactableOutput("table")                ),    title = h2("Editar informações"),    size = 'l',    footer = tagList(      modalButton("Cancel")    )  ))    # Select rows  updateReactable("table", selected = c(1, 3, 5))  })  }  shinyApp(ui, server)  
https://stackoverflow.com/questions/67362731/r-shiny-reactable-selection-option-to-update-checkboxes-using-updatereactable May 03, 2021 at 10:05AM

没有评论:

发表评论