-
Notifications
You must be signed in to change notification settings - Fork 684
Implement selectedMax feature #726
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
Conversation
Mostly changing to $naming scheme for jQuery objects and adding more comments.
bind() is deprecated. Use on() instead.
Changed the default selectedText to be "# of # selected" so that developers will be aware that this form is available. (It always has been available..)
|
Will re-open later. |
|
Re-opening. Found the problem. ;-) |
|
There is a question of what to do with checkAll if a selectedMax constraint is in place. Perhaps any selections beyond the selectedMax limit are cleared? BTW, I already use selectedMax (I call it maxSelected) constraint feature in my old code version that I am using in my web app. I am just trying to make sure I "tidy it up" here if other people are going to be using it, also. |
|
Okay, I rebased your last branch to squash it down. That means the history is a little different now between these branches. Don't worry though, it's an easy fix! You might want to make a branch off this branch to test on the first time you do the
What this does is take 2 commits off your current branch and replays them on top of the target branch. It's essentially a simplified cherry pick since you're only pulling off the top. |
|
Sorry I didn't respond to your question sooner. I would say it would be best to disable select all when the selectedMax feature is enabled. I don't think it would make sense to trim the options list down, and just selecting the first x rows options wouldn't be helpful either. |
|
Ok I will tweak this a bit more in a subsequent PR to address the concerns. |
|
Yeah if this is in 728 as well I'll just merge it all at once. |
The selectedMax option limits the number of selections to a maximum value. If the user attempts to check an additional selection in the multi-select, a warning message is shown in the button for 1 second.
This feature is very useful for the "select up to a maximum of x out of y available selections" use case. It implements a constraint approach.
An additional unit test has been also added for this feature.
NOTE: This PR follows PR #725 in succession.