Chosen's “Multiple Select”

谁说我不能喝 提交于 2019-12-06 04:19:03

问题


I have just discovered Chosen. The library is somewhat large, especially that I am only interested in the "Multiple Select" feature.

Is there a way to build a slimer Chosen just for "Multiple Select"?


回答1:


Do you mean the facebook like tab completion multiple select type feature? If so ... there are a number of tutorials on line for writing your own. The only way I can imagine you can 'slim down' Chosen is not to! I took a look at the source and it appears to me that the 'multi select' aspect is pretty core to Chosen's functionality. I'm not sure you'd get much out of that route.

If you want to write your own, here is a tutorial you could follow to get write functionality you want:

  • How to write a facebook like multiselect

Alternately you could check out some other libraries. I found a couple:

  • FCBKcomplete - only 11k!
  • Proto!MultiSelect - bigger :(
  • jQuery tokenInput - flexible looking.
  • TextExtJS - cool kid approved - is it small? dunno.

'Somewhat large' is a subjective term, but to me the 18k sounds pretty slim for the minified version of Chosen. Plus its the one I've used, and have been happy with. However - other libraries abound, so...happy hunting!



来源:https://stackoverflow.com/questions/8774588/chosens-multiple-select

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