Skip to content
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

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

Open
1 task done
GinsbergsFoods opened this issue Sep 5, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@GinsbergsFoods
Copy link

Guidelines

  • I agree to follow this project's Contributing 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

@GinsbergsFoods GinsbergsFoods added the bug Something isn't working label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant