Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 901
mchen Avatar asked Nov 02 '22 00:11

mchen


1 Answers

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'))

like image 104
jdharrison Avatar answered Nov 14 '22 11:11

jdharrison