reactable icon indicating copy to clipboard operation
reactable copied to clipboard

Highlight searched term, get search term in Shiny

Open shahreyar-abeer opened this issue 3 years ago • 2 comments

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

shahreyar-abeer avatar Dec 15 '21 09:12 shahreyar-abeer

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.

glin avatar Jan 03 '22 03:01 glin

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!

shahreyar-abeer avatar Jan 04 '22 06:01 shahreyar-abeer