Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set ui-select to readonly mode?

Is it possible and how to make my ui-select readonly? Of course I've tried ng-readonly="isReadOnly" where I define in my controller $scope.isReadOnly=false; And of course I want to calculate it "in runtime" according to data from server that can change the state.

like image 617
Alexander Vasilyev Avatar asked Aug 12 '15 16:08

Alexander Vasilyev


2 Answers

If you need to view the options and disable text typing, you can use search-enabled option

<ui-select search-enabled="false" ...> ... </ui-select>

DEMO here

like image 22
Lucky_hunter Avatar answered Nov 12 '22 22:11

Lucky_hunter


Use ng-disabled instead of ng-readonly.

<ui-select ng-disabled="isReadOnly" ...>
    ...
</ui-select>
like image 79
Alexander Vasilyev Avatar answered Nov 12 '22 21:11

Alexander Vasilyev