I have a shiny application that lets the user filter data, eventually the user should be able to download the filtered data but I cannot access the filtered/shown data from reactable.
An MWE would be the following: (Note that the getReactableState()
function does not return the filtered data but would work if one had to select all filtered data.)
library(shiny)
library(reactable)
ui <- fluidPage(
reactableOutput("table"),
verbatimTextOutput("table_state")
)
server <- function(input, output) {
output$table <- renderReactable({
reactable(iris, filterable = TRUE)
})
output$table_state <- renderPrint({
print(getReactableState("table")) #< wrong code here...
# the goal would be to get the rows which are currently shown here
})
}
shinyApp(ui, server)