Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had a case when I was need to search in selector by some value but in the same time I couldn't show those values in the selector. For example I have a list of users and my users have some similar attribute like department or every user has a unique id and I want to make search by this id but in the option or opt group I should display another information and cannot display the values which I want to user for search. I couldn't search by values also because the list was dynamically rebuild and it was hard to select values dynamically. I hope that makes sense.
I wanted to be able to define selector like this
So after that I can search values by "cheese" or "vegetables" and I don't have to add "cheese" or "vegetables" to every item (which would be look ugly). I could add those values to every "value" attribute of the options but then the method like
.val()
or.multiselect('select', val)
would be broken (in case if I need to get unique values of objects in the list).