-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: replaceData #49
Comments
Hi, Yup this is possible, and something I started working on a while back. It'll be added through something like |
It sounds great! Ideally, I would like to make a proxy table with other nested proxy tables inside. Unfortunately it doesn't seem possible with DT, maybe it will be possible with reactable in the future? |
Added a The And here's another toy app that simulates real-time data updates: https://github.com/glin/reactable/blob/master/inst/examples/shiny-data-streaming.R |
Nested proxy tables should already be supported, but it's definitely not well tested. You may stumble upon some bugs :). To use reactable(
details = function(index) {
reactableOutput("nested_table")
}
) Here's an example app that uses library(shiny)
library(reactable)
data <- MASS::Cars93[, 1:7]
ui <- fluidPage(
selectInput("filter_type", "Filter type", unique(data$Type), multiple = TRUE),
reactableOutput("table")
)
server <- function(input, output) {
output$table <- renderReactable({
reactable(
data,
defaultExpanded = TRUE,
details = function(index) {
if (index == 2) {
reactableOutput("nested_table")
}
}
)
})
output$nested_table <- renderReactable({
reactable(data, selection = "multiple", bordered = TRUE)
})
observeEvent(input$filter_type, {
if (length(input$filter_type) > 0) {
filtered <- data[data$Type %in% input$filter_type, ]
} else {
filtered <- data
}
updateReactable("nested_table", data = filtered)
}, ignoreNULL = FALSE)
}
shinyApp(ui, server) |
This is awesome! |
It's possible to update and not reset expansion? |
Hi, first of all a great package! Thank you for your time and effort!
Is it possible to make a function like replaceData in DT?
https://rdrr.io/cran/DT/man/replaceData.html
I'd like to update my table without regenerating it every time I change the inputs.
The text was updated successfully, but these errors were encountered: