jquery select2 howto make dont close after select

时光毁灭记忆、已成空白 提交于 2019-12-10 01:42:42

问题


  1. When using "Multi-Value Select Boxes" http://ivaynberg.github.io/select2/ slect box drop back after each selection. Is there the way not to do it, so user can select few of it without extra click to select box?

  2. Also interested in group options. In demo url above, "Pasific Time Zone", "Mountain Time Zone" not clickable. How to make it clickable and autoselect child items?


回答1:


Question 1:

From the documentation I can see this option:

closeOnSelect: false

This option is set to true by default, meaning the select box closes on select.

So, this is a simple call of the plugin:

$('#mySelect').select2({
    closeOnSelect: false
});

Question 2:

This question is a bit vague. It's a fairly simple task, but without going through the plugin's files and understanding its logic, it's difficult to know how to answer — and I'm not spending hours trying. This is something you'll have to try yourself, as I personally don't think you'll find anyone here willing to do that for free. It's asking a little bit much.

Take a look at its files and see if you can work out what is going on and try something. People will always be willing to help if you've tried. Good luck.



来源:https://stackoverflow.com/questions/26395096/jquery-select2-howto-make-dont-close-after-select

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