Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maximumSelectionSize not working #13

Open
sebackend opened this issue Jan 2, 2018 · 0 comments
Open

maximumSelectionSize not working #13

sebackend opened this issue Jan 2, 2018 · 0 comments

Comments

@sebackend
Copy link

sebackend commented Jan 2, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant