I am building a complex dashboard with approximately 32 boxes showing different types of information. Some of the boxes display tables (rendered using knitr), some display plots (produced by ggplot). Regardless, each box gives users the option to download both the plot and a customized data set containing the plotted data (in a csv file).
I have individual downloadButtons and an instance of downloadHandler associated with each download. The code for these blocks follows the examples available in the shiny documentation. I’m not looking forward to maintaining 50 to 60 instances of the downloadHandler to manage all of the downloads.
Are there any examples of putting the downloadHandler in a wrapper function? Ideally, I’d like to pass an output parameter, a file name parameter and an output type parameter to the function.
Thanks in advance