How to set ui-select to readonly mode?

14,718

Solution 1

Use ng-disabled instead of ng-readonly.

<ui-select ng-disabled="isReadOnly" ...>
    ...
</ui-select>

Solution 2

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

Share:
14,718
Alexander Vasilyev
Author by

Alexander Vasilyev

Corporate software architect. Primary technologies: MS SQL Server, ASP.NET WebAPI OData, AngularJS.

Updated on June 15, 2022

Comments

  • Alexander Vasilyev
    Alexander Vasilyev almost 2 years

    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.

  • Sealer_05
    Sealer_05 over 8 years
    This does not allow you to view the options