thomasp85 / shinyFiles

A shiny extension for server side file access
196 stars 47 forks source link

Set "Details View" as default in shinySaveButton #132

Closed carlosavellaneda8 closed 4 years ago

carlosavellaneda8 commented 4 years ago

Hi,

I wanted to know if it is possible to set "Details View" as default using shinySaveButton. Currently, the default is "Icon View".

Best regards, Carlos

vnijs commented 4 years ago

There is not a way to change the setting by default. However, I agree that the detail view might be the better default

vnijs commented 4 years ago

@carlosavellaneda8 I just pushed some changes to the version of shinyFiles on GitHub. If you run the example in inst/example you will see that shinyFilesButton and shinySaveButton in ui.R now use a new viewtype argument. The default viewtype is set to detail but you can still specify list or icon if you prefer. Please try it out using the code below

if (!require("remotes")) install.packages("remotes")
remotes::install_github("thomasp85/shinyFiles")
vnijs commented 4 years ago

I'm closing this issue. Detail view will be the new default. Thanks for this suggestion @carlosavellaneda8. If you look at the example file in inst/example, you will see how you can change the default to icon or list view if you prefer. Also the example below.

shinySaveButton(
    "save", "Save file", "Save file as...", 
    filetype = list(text = "txt", picture = c("jpeg", "jpg")), 
    viewtype = "icon"
)