Appsilon / reactable.extras

Extra features for reactable package
https://appsilon.github.io/reactable.extras/
38 stars 4 forks source link

[Bug]: Server-side processing does not render nested tables beyond first page #62

Open GinsbergsFoods opened 2 weeks ago

GinsbergsFoods commented 2 weeks ago

Guidelines

Project Version

No response

Platform and OS Version

Ubuntu 20.04

Existing Issues

No response

What happened?

I have a huge reactable table with a huge nested table inside. In order to speed up rendering, I tried out the reactable_extras_server() option. At first glance, it works wonders, however if I use the server-side pagination and navigate to another page, the outer table updates/renders, but then the nested table on these subsequent pages still reflects the nested table on the first page. My only way around this is to specify total_pages = 1, which slows everything way back down.

Steps to reproduce

  1. Use reactable.extras to create app with server-side processing
  2. Build a nested table (table with expandable rows)
  3. See code example below ...

Expected behavior

with server-side pagination, nested tables rendered with reactable() should also be rendered

Attachments

library(shiny) library(reactable) library(reactable.extras)

df <- MASS::Cars93[, 1:4] df$Date <- sample(seq(as.Date("2020/01/01"), as.Date("2023/01/01"), by = "day"), nrow(df)) df$Check <- sample(c(TRUE, FALSE), nrow(df), TRUE) data <- unique(MASS::Cars93[, c("Manufacturer", "Model")]) shinyApp( ui = fluidPage( reactable_extras_dependency(), reactable_extras_ui("table"), hr(), textOutput("date_text"), textOutput("button_text"), textOutput("check_text"), textOutput("dropdown_text"), textOutput("text") ), server = function(input, output) { reactable_extras_server( "table", data = data, details = function(index){ df = df[df$Manufacturer == data$Manufacturer[index],] htmltools::div(style = "padding: 1rem", reactable(df, outlined = TRUE, columns = list( Check = colDef( header = tooltip_extra(content = "Checkbox"), cell = checkbox_extra("check"), align = "left" ), Date = colDef( header = tooltip_extra(content = "Date input"), cell = date_extra("date") ), Type = colDef( header = tooltip_extra(content = "Type dropdown"), cell = dropdown_extra("dropdown", unique(df$Type)) )))) }, columns = list( Manufacturer = colDef( header = tooltip_extra(content = "Manufacturer type"), cell = button_extra("button") ), Model = colDef( header = tooltip_extra(content = "Model input"), cell = text_extra("text") ) ) ) } )

Screenshots or Videos

No response

Additional Information

No response