reactable icon indicating copy to clipboard operation
reactable copied to clipboard

How to know when the selection has changed?

Open justacec opened this issue 2 years ago • 1 comments

It is not clear from the examples and the documentation how to tell (what input to observe) when the selection has changed in a shiny app. I notice that the shiny demo for reactable somehow does it but that element of the demo code is not available to look at.

I know that selectionID used to be an input that one could watch, but that is being deprecated in favor of the get state function.

Can somebody here point me in the right direction to know what to watch for to see if the selection has changed?

justacec avatar Jul 11 '22 03:07 justacec

Have you seen the Row selection Shiny example on the Examples page? There's no live demo for that, but you can copy and run this minimal app in a console to see how you can watch the selection state and do things when rows are selected. getReactableState(tableId, "selected") is pretty much the Shiny input you'd use in an observer or Shiny output.

glin avatar Jul 16 '22 21:07 glin