Restricting User on ability to chose maximum items from selectInput

霸气de小男生 提交于 2020-01-13 10:24:07

问题


Shiny function selectInput() gives an option to select multiple items from the dropdown list with 'multiple = TRUE'

However I want to restrict user on how many items max can be chosen from underlying dropdown list.

Can you please suggest if that is possible with Shiny.

Appreciate for any pointer.

Thanks,


回答1:


You can do this if you define it as selectizeInput() instead of selectInput(), and use the options = list(maxItems = n) parameter.

For example

selectizeInput("select", "Select", LETTERS, options = list(maxItems = 4))


来源:https://stackoverflow.com/questions/44146939/restricting-user-on-ability-to-chose-maximum-items-from-selectinput

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!