Appsilon / reactable.extras

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

feat: Ensures custom inputs work with `reactable_extras_server` #38

Closed andyquinterom closed 1 year ago

andyquinterom commented 1 year ago

Issue #32

Changes description

Eduardodudu commented 1 year ago

Great job!

I have tested both with extensions of custom_inputs and also standard reactables and it worked properly:

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
    )
  }
)
codecov-commenter commented 1 year ago

Welcome to Codecov :tada:

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered :open_umbrella: