The problem of adding full selection option in the use of select2

The
  1. select2 option adds a select all option in addition to some options.

`< select multiple= "" id= "busSelect" >
< option value= "- 1" data-select2-id= "2" > all < / option >
< option value= "227" data-select2-id= "10" > Mobile BU < / option >
< option value= "228" data-select2-id= "11" > computer BU < / option > < option value= "264" data-select2-id= "12" > Wechat Mobile QQ < / option >
< option value= "277" data-select2-id= "13" > first-level customer service < / option >
< / select

  1. option data is dynamic

demand:

  1. Select all, select other items, and click Filter to remove all options from the text box.
  2. Select other items, and then select all. Remove other items in the text box when you click Filter.
  3. structure diagram:

clipboard.png

Select all first, then select other items, and remove all other items from the text box.
Select other items first, then select all, and remove other options from the text box.

Apr.20,2021

have you solved it, brother?

Menu