abilinski / COVID19

MIT License
2 stars 0 forks source link

Reset Buttons for Contact Matrix & All Parameters [shiny] #8

Open ctesta01 opened 4 years ago

ctesta01 commented 4 years ago

https://stackoverflow.com/questions/24265980/reset-inputs-button-in-shiny-app

The two top responses on this stackoverflow post go over how to implement reset buttons.

The first approach in summary: "The trick is to use uiOutput and wrap the inputs you want to reset in a div whose id changes to something new each time the reset button is pressed."

The second approach is written by the developer of shinyjs and uses the shinyjs::reset function.

The author argues that the second approach is better because it keeps UI in the UI instead of all being moved to the server.

ctesta01 commented 4 years ago

Update on this -- so we've got the reset button working for all of the parameters, but we should have one for just the intervention parameters, and also one(s) for the contact matrices.