Reputation: 932
Here is my code for a very basic shiny app. It of requires the packages shiny as well as the shinysky library from github: https://github.com/AnalytixWare/ShinySky
Here is a reproducible example:
testing <- function() {
shinyApp(ui = fluidPage(
sidebarLayout(
sidebarPanel(
select2Input("select2Input3",
"Multiple Select 2 Input",
choices = c("a","b","c"),
selected = c("b","a"),
type = "select")
),mainPanel(
))
), server = function(input, output){})
}
testing()
I am confused as to why even though I have choices as c("a", "b", "c"), the dropdown will only select b and have no other choices. I have also tried just selected = "b", but with no luck. I looked at the examples for shiny sky and I can't see what I am missing. The video tutorial showed the same type of dropdown but had "b" selected, yet the user could also click on "a" or "c" in the dropdown: https://www.youtube.com/watch?feature=player_embedded&v=9T4F-j76Vf0&noredirect=1
I may be missing something obvious, but I can't seem to find it right now. Thank you!
Upvotes: 0
Views: 792
Reputation: 306
You have to add the parameter "multiple" in your select2Input and set it to TRUE (like it is in the video). It is FALSE by default.
select2Input("select2Input3",
"Multiple Select 2 Input",
choices = c("a","b","c"),
selected = c("b","a"),
type = "select",
multiple=TRUE)
Edit: it doesn't work for me either. The select2Input may need an update. His exemple shinysky::run.shinysky.example() don't work anymore for Select2.
Upvotes: 1