select2-multi-checkboxes
select2-multi-checkboxes copied to clipboard
maximumSelectionSize not working
Trying to set a limit for selected elements with the option maximumSelectionSize is not working even if i overwrite the plugin:
$('#my-select').select2MultiCheckboxes({
maximumSelectionSize: 2 // THIS IS NOT WORKING
})
$.fn.extend({
select2MultiCheckboxes: function() {
var options = $.extend({
placeholder: 'Choose elements',
maximumSelectionSize: 2, // THIS IS NOT WORKING
formatSelection: function( selected, total ) {
return selected.length + ' > ' + total + ' total';
},
wrapClass: 'wrap'
}, arguments[ 0 ] );
this.each(function() {
...
I'm using the 3.5.2 version of select2