glin / reactable

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

Highlight searched term, get search term in Shiny #218

Open shahreyar-abeer opened 2 years ago

shahreyar-abeer commented 2 years ago

Hi there,

Thanks for the awesome package. I needed to use a couple of functionalities.

  1. Highlight the searched term in the table.
  2. Get the input in the search box as a string in the server of a Shiny app.

I'd be glad if you could kindly guide me towards them. Once again, great work with the package.

Best, Zauad

glin commented 2 years ago

Hi, highlighting searched terms should be technically possible with the new filterValue and/or searchValue properties in the cell JS render functions: https://glin.github.io/reactable/articles/custom-rendering.html#cells-js-render-function. I made an example before but will have to find it. I remember it being kind of tricky, so it's a candidate for a built-in feature in the future.

Getting the search value from Shiny isn't currently possible, but I'll add it as a feature request.

shahreyar-abeer commented 2 years ago

Hi,

Thanks for the explanation. I'll wait for it to become a built-in feature. But for now, I could use the example that you mentioned. Please share it at your convenience.

Thanks!