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?
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.
closeOnSelect: false
and if max selected options are limited then you can select more than that limit. –
Glaudia Working for me
$('.select2').each(function() {
$(this).select2({
dropdownParent: $(this).parent(),
closeOnSelect: false
});
});
© 2022 - 2024 — McMap. All rights reserved.