Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable selected choices in angular-ui-select multiselect mode

In ui-select muliple mode, selected choices are removed(checked in source code too) from the choices list but I just need that selected choices to be disabled, like below, instead of being removed.

enter image description here

this above image is taken from chosenjs.

There is an option, ui-disable-choice, to disable the choices but it just make the choice entirely unselectable.

<ui-select-choices ui-disable-choice="person.name=='Adam'" repeat="person in people">
  <div ng-bind-html="person.name"></div>
</ui-select-choices>

So, How to make the selected choices to appear in the choices but disabled?

plnkr example here.

like image 849
Venugopal Avatar asked Feb 18 '16 06:02

Venugopal


1 Answers

The feature you are asking for is available in ui-select v0.17.2 or later. https://github.com/angular-ui/ui-select/wiki/ui-select#examples-disabling-instead-of-removing-selected-items-in-multiple-selection

like image 156
Benny Johansson Avatar answered Sep 30 '22 18:09

Benny Johansson