2014-11-05 51 views
4

我正在使用angular ui-select指令,并尝试使用禁用ng选项禁用它。角度ui-select中的ng-disabled选项缩小文本框

<ui-select multiple ng-model="address.selected" 
      theme="bootstrap" 
      ng-disabled="true" 
      reset-search-input="true" 
      style="width: 300px;"> 

这里是plunker http://plnkr.co/edit/julETCG4zCGAxFJ0PSBF?p=preview

文本框的大小与NG-禁用= “真正的” 收缩。

+0

您的plunkr在控制台中有错误,导致它无法运行。 – Blazemonger 2014-11-05 21:25:55

回答

4

更新theme如下面所示的bootstrapselect2

<ui-select multiple ng-model="address.selected" 
     theme="select2" 
     ng-disabled="true" 
     reset-search-input="true" 
     style="width: 300px;"> 

如果你想bootstrap主题再加入这个而不是风格:

.ui-select-multiple.ui-select-bootstrap { 
    min-height: 34px;   
    height: auto; 
    padding: .3em; 
} 

如图所示here

+0

它适用于select2主题,但我想要bootstarp主题。 – swe 2014-11-05 21:38:34

+1

查看我的更新回答。 @swe – dmahapatro 2014-11-05 21:52:41

+0

谢谢!它的工作 – swe 2014-11-05 21:59:12