2017-02-19 12 views
0

ここでは私の問題のためにplunkerであることが唯一の検索可能:私は唯一のドロップダウンメニューが検索したいと思いhttp://plnkr.co/edit/9DsLidTZR7RJDEq6PW0H?p=previewangularjs無効にドロップダウンリストをUI-選択し、

:使用は、ドロップダウン項目のリストを見ONLYユーザーが入力を開始したときに、入力された単語または文字を含む対応する項目のみがリストに表示されます。そうでない場合、リストはまったく表示されません。

<ui-select ng-model="person.selectedValue" theme="select2" ng-disabled="disabled" style="min-width: 300px;" title="Choose a person"> 
    <ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.value.name}}</ui-select-match> 
    <ui-select-choices repeat="person.value as (key, person) in peopleObj | filter: {'value':$select.search}"> 
     <div ng-bind-html="person.value.name | highlight: $select.search"></div> 
     <small> 
     email: {{person.value.email}} 
     age: <span ng-bind-html="''+person.value.age | highlight: $select.search"></span> 
     </small> 
    </ui-select-choices> 
    </ui-select> 

答えて

1

あなたはng-styleを使用して、選択肢ul heightプロパティを変更することができます。ライブラリにOOBソリューションがないと思わないでください。

<ui-select-choices ng-style="($select.search != '')? {'height' : 'auto'}: {'height' : '0px'}" repeat="person.value as (key, person) in peopleObj | filter: {'value':$select.search}"> 
     <div ng-bind-html="person.value.name | highlight: $select.search"></div> 
     <small> 
     email: {{person.value.email}} 
     age: <span ng-bind-html="''+person.value.age | highlight: $select.search"></span> 
     </small> 
</ui-select-choices> 

私たちに知らせてください。

関連する問題