0

I have a shiny app where I want to download a csv version from the DT package. This used to work but most recently does not:

library(DT)

  datatable(mtcars, extensions = 'Buttons', options = list(
    initComplete = JS(
      "function(settings, json) {",
      "$(this.api().table().header()).css({'background-color': '#0894e5', 
'color': '#000000'});",
      "}"),
    pageLength = 100,
    dom = 'Bfrtip',
    buttons = 
      list('copy', 'print', list(
        extend = 'collection',
        buttons = c('csv', 'excel', 'pdf'),
        text = 'Download'
      ))

  )
  )

This is what the table looks like: enter image description here

Then when I try to click download csv, it doesn't work: enter image description here

Any ideas why?

nak5120
  • 4,089
  • 4
  • 35
  • 94

1 Answers1

1

Some times strange errors start showing up. While restarting R and/or Rstudio will work in many instances, sometimes you may need to re-install R-Studio or upgrade the RStudio version. My Rstudio stopped displaying plotly outputs a few months ago. Once I upgraded the RStudio version, it started working again.

YBS
  • 19,324
  • 2
  • 9
  • 27