Open vibalre opened 1 year ago
I think this task is already working. I updated this code for using filtering, search and multiple selection and it worked.
library(shiny)
library(reactable)
library(reactable.extras)
mtcars_ultra <- purrr::map(
seq(1L, 20000L, by = 1L),
~ {
temp_df <- mtcars
temp_df$make <- rownames(temp_df)
rownames(temp_df) <- NULL
temp_df <-
dplyr::mutate(temp_df, id_row = paste0("id_", dplyr::row_number(), "_", .x))
temp_df
},
.progress = TRUE
) |>
purrr::list_rbind()
shinyApp(
reactable_extras_ui("test"),
function(input, output, server) {
reactable_extras_server(
"test",
filterable = TRUE,
searchable = TRUE,
selection = "multiple",
data = mtcars_ultra,
columns = list(
mpg = colDef(name = "Miles per Gallon"),
cyl = colDef(name = "Cylinders"),
disp = colDef(
name = "Displacement",
cell = button_extra("button")
)
),
total_pages = 4e4
)
}
)
I noticed from the code example I made that the filter is actually only filtering what is being rendered per page and not actually filtering the whole dataset
Any development on the search/filter functionality? What's the latest update?
At the moment, the filter only works for the rendered page as is mentioned in the previous comment by @Eduardodudu
+1 Adding a vote to please support this feature. Unfortunately without this, using reactable for large dataframes in Shiny doesn't really work, except for very basic displays like just showing tiny parts of the table one page at a time...
Thanks!
Guidelines
Description
Just like a common
reactable
, there should be an interface for the user to search values.Problem
A search interface will make it easier for users to look for what they need in the data.
Proposed Solution
Add another UI on top of the
reactable
, a search box or text input, that will update thereactable
data on the server-side based on the input.Alternatives Considered
Since the pagination is handled on the server-side, searching will most likely happen on the server-side too.