glin / reactable

Interactive data tables for R
https://glin.github.io/reactable
Other
612 stars 79 forks source link

Pass a search widget string into the global filter #334

Open LELULAS opened 10 months ago

LELULAS commented 10 months ago

When using reactable in a shiny app, I'd like to hide the table until a user inputs a global search into a search widget. How can I pass the string from the search widget into the global search of the reactable?

glin commented 10 months ago

If you have the search widget in Shiny, there's not a way to set the global search value via Shiny directly, but that could definitely be a future enhancement.

For now, the only way to do this is using the JavaScript API - reactable.setSearch(). There's a quick demo in custom search input example, but hooking this up to Shiny would take a bit more effort. I can't remember how to do this off the top of my head, but it's probably described in the JavaScript Events in Shiny doc page.