You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a case where I may have thousands of possible options and I want to avoid having to retrieve all the possible options from my API before we can use the dropdown.
Is there a way to retrieve the list dynamically using asynchronous ajax calls to return the options based on a minimum character input from the user ?
Basically, this feature is available on the "select2" plugin using the "ajax" or "query" parameters (http://ivaynberg.github.io/select2/). I was using this plugin which is awesome but doesn't have any checkbox multi-select feature. I'm looking into using yours but this is the only thing where I'm afraid I'll get stuck having problems.
The text was updated successfully, but these errors were encountered:
On a second thought, this hack is not pretty but might work:
In your controller:
Prepare an empty array variable for the input model, say $scope.inputModel
Not necessary, but you can set a simple flag, say $scope.gotData = false;
In your view:
Create a text box for your search input. Put an event listener or on-change here, calling an AJAX function to populate the $scope.inputModel as the user types something. If there's data, set $scope.gotData to true. If not, set to false.
Create an instance of this multi-select directive (you can remove the filter element if you want to), but disable it until the AJAX call from number (1) returns something (or after the input model is populated). You can use is-disabled="!gotData" attribute to do this.
I have a case where I may have thousands of possible options and I want to avoid having to retrieve all the possible options from my API before we can use the dropdown.
Is there a way to retrieve the list dynamically using asynchronous ajax calls to return the options based on a minimum character input from the user ?
Basically, this feature is available on the "select2" plugin using the "ajax" or "query" parameters (http://ivaynberg.github.io/select2/). I was using this plugin which is awesome but doesn't have any checkbox multi-select feature. I'm looking into using yours but this is the only thing where I'm afraid I'll get stuck having problems.
The text was updated successfully, but these errors were encountered: