nobleclem/jQuery-MultiSelect

Set max selected limit

Closed this issue · 1 comments

Hello,

I am using your plugin, and I have 2000 records, which sometimes is selected completely, so it's problem to pass it to Django. Anyway I want to set maximum limit.

PS: it will be better to select all when search field is not empty, I mean have such option in constructor.

Right now nothing exists. However its possible to do using the onOptionClick callback.

You could use it to count the number of selected values and then throw whatever error/warning/notice when a user attempts to select another. I have not really put much thought into how this would make sense to implement if I were to add it as a feature.

Oh there is an example of limiting to one item in Issue #43 that could guide you.