mchen
mchen

Reputation: 10156

How to get option groups with a selectize control in R Shiny?

A selectize.js control supports optgroup functionality, as demonstrated:

enter image description here

That is, in the above, "Climbing" is just a heading rather than a selectable option.

In R Shiny, this is selectize controls are produced using selectizeInput. But how can you achieve option groups with a selectizeInput?

Upvotes: 5

Views: 2277

Answers (1)

jdharrison
jdharrison

Reputation: 30445

This is an open issue and will probably be fixed soon

https://github.com/rstudio/shiny/issues/326

perhaps choices in selectInput() can also take a list of character vectors to generate , e.g. choices = list(Eastern = c('NY', 'MA'), Western = c('CA', 'WA'))

Upvotes: 2

Related Questions