Reputation: 365
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?
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?
Upvotes: 24
Views: 35995
Reputation: 1
Working for me
$('.select2').each(function() {
$(this).select2({
dropdownParent: $(this).parent(),
closeOnSelect: false
});
});
Upvotes: 0
Reputation: 19723
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.
Upvotes: 50