problem with download button on navBarPage

19 views
Skip to first unread message

Jeff Diamond

unread,
Aug 26, 2016, 5:04:14 PM8/26/16
to Shiny - Web Framework for R

When I put a download button inside a navBarPage, clicking on the button opens a copy of the entire shiny app in a new tab, instead of starting a download.

Any ideas why this might be happening or how to get around it?

example code is below:

ui.R:

shinyUI(navbarPage("my page", id="nav",
 tabPanel("my tab",
      downloadLink('downloadData', 'Download')
    )
))



server.R:

shinyServer(function(input, output) {
    output$downloadData <- downloadHandler(
   
    filename = "cars.csv",
    content = function(file) {
      write.table(cars, file)
    }
  )
})

Joe Cheng

unread,
Aug 26, 2016, 5:34:00 PM8/26/16
to Jeff Diamond, Shiny - Web Framework for R
It works for me. What version of Shiny are you using?

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/f049c60f-a711-479c-b70d-941008a1947a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages