1

Is there a way to filter values in an AngularJS selectize control? I would like to be able to type in the selectize dropdown to filter my results. I know this is possible with the ui-select control, but since I'm returning a large amount of values, the selectize seems to offer greater performance, but I can't find the filtering capability of it (so far).

I'm using angular-selectize2, version 1.2.3 if that helps with any answers.

2 Answers 2

3

After some additional research, I believe I found the answer to my own question. Apparently in the $scope.myConfig section of the selectize, if you specify a "searchField," along with a value (ex: searchField: 'MyFieldName'), the filtering while typing in the selectize magically happens.

This Angular Selectize plunkr link provided the necessary answer for me: http://embed.plnkr.co/2lN4NRFN8VF6kUZqPs0M/

Sign up to request clarification or add additional context in comments.

Comments

0

Why not make a normal select menu and repeat the options based on a filtered dataset

<input type="text" ng-model="selectFilter" />
<select name="whatever">
    <option ng-repeat="option in options | filter:selectFilter" value="{{option.value}}">{{option.text}}</option>
</select>

This assumes the data for your options is in your controller

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.