在 angular-ui-select multiselect 模式下禁用 selected 选择
Disable selected choices in angular-ui-select multiselect mode
在 ui-select
多重模式中,选定的选项从选项列表中删除(也在源代码中检查)但我只需要禁用选定的选项,如下所示,而不是被删除。
上图来自chosenjs。
有一个选项 ui-disable-choice
可以禁用选项,但它只会使选项完全无法选择。
<ui-select-choices ui-disable-choice="person.name=='Adam'" repeat="person in people">
<div ng-bind-html="person.name"></div>
</ui-select-choices>
那么,如何让选中的选项出现在选项中却被禁用呢?
plnkr 此处示例。
您要求的功能在 ui-select
v0.17.2 或更高版本中可用。
https://github.com/angular-ui/ui-select/wiki/ui-select#examples-disabling-instead-of-removing-selected-items-in-multiple-selection
在 ui-select
多重模式中,选定的选项从选项列表中删除(也在源代码中检查)但我只需要禁用选定的选项,如下所示,而不是被删除。
上图来自chosenjs。
有一个选项 ui-disable-choice
可以禁用选项,但它只会使选项完全无法选择。
<ui-select-choices ui-disable-choice="person.name=='Adam'" repeat="person in people">
<div ng-bind-html="person.name"></div>
</ui-select-choices>
那么,如何让选中的选项出现在选项中却被禁用呢?
plnkr 此处示例。
您要求的功能在 ui-select
v0.17.2 或更高版本中可用。
https://github.com/angular-ui/ui-select/wiki/ui-select#examples-disabling-instead-of-removing-selected-items-in-multiple-selection