Closed smach closed 6 years ago
I have not done this in a while and am off computer but I think you just need fnDrawCallback as shown in https://github.com/htmlwidgets/sparkline/issues/22.
For a longer discussion https://github.com/rstudio/DT/issues/410 might be helpful.
Yes that's it exactly. Adding
options = list(
fnDrawCallback = htmlwidgets::JS(
'
function(){
HTMLWidgets.staticRender();
}
'
)
to my datatable solves the problem. I'll make myself an RStudio code snippet to remember and will be good to go in the future. Thanks very much!!
@smach, great - I will close. Feel free to reopen.
In following the example code from this stackoverflow question: https://stackoverflow.com/questions/47041415/include-sparkline-htmlwidget-in-datatable-cells-in-a-shiny-app-without-resortin
The sparklines show up on the first page of the data table but not subsequent pages. Do you know how to get the sparklines to appear on all pages of the table?