質問

I have a scenario where I'd like to display a list of selected items but the selected items should be able to have the same value selected twice. The select2 control doesn't allow the same item to be selected more than once.

Example:

Options: Wheel, Door
Results: Wheel, Wheel, Wheel, Wheel, Door, Door

I want to be able to select say 4 wheels and 2 doors. So a total of six items would be selected. The backend of my system will then determine how to save the six items. I really just like to use the select2 for the UI portion. I understand the native select html allows multiple selections but the same value can't be selected twice. I'm looking for a UI component to handle this. I could have two select2 controls one to select the item and then send the results to another textbox but looking to see if anyone has implemented this using the great select2 control.

役に立ちましたか?

解決

The issue was discussed on Github. Looks like the last comment (until now) says: select2 doesnt support duplicates. that is on the roadmap for 4.0.

UPDATE: It is now supported in Select2 v.4.0

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top