I am having trouble with this. The documentation is divided into Usage and API .
The selectize.js download function is used for request / response services that return subsets of the available data depending on the request. It makes sense that it will fire whenever a request changes.
Of course, this is not necessary if your data source does not accept query parameters. In this case, a one-time data download should be sufficient.
According to the API, you can grab a selectize instance and call a number of methods on it, including loading.
<script> var $select = $('#select').selectize({ valueField: 'value', labelField: 'label', searchField: ['label'] }); var selectize = $select[0].selectize; selectize.load(function (callback) { $.ajax({ url: 'http://localhost:64596/api/things', type: 'GET', error: function (e) { console.error(e.responseText); callback(); }, success: function (data) { callback(data); } }); }); </script>
source share