Closed aavanesy closed 3 years ago
Solved it with this solution...
if (window.Shiny) {
Shiny.setInputValue('show_details', { index: 0})
Shiny.setInputValue('show_details', { index: rowInfo.index + 1 })
}
Glad you found a solution. As an alternative, Shiny also added a feature a while back to help with issues like this:
If you’re using input$foo to provide notifications that, say, a button has been clicked, you don’t want Shiny to “helpfully” suppress some of those notifications in an effort to save you work. You want to be notified for every call of Shiny.setInputValue.
As of Shiny v1.1, you can opt out of the optimizations and have Shiny notify you of every set, by passing a priority: "event" option:
Shiny.setInputValue("foo", "bar", {priority: "event"});
This will cause input$foo to notify any reactive objects that depend on it, whether its value has actually changed or not.
https://shiny.rstudio.com/articles/communicating-with-js.html
I think I'll change the example in the docs to set input values like this.
Please see the example below.
When I click on the same Details button more than once it does not trigger