How do I set the selectize.js options list programmatically?

You can use load method to set options via programmatic API. You may also want to call clear and clearOptions methods to reset selected values and old options. Here is how to put it all together: var selectize = $(“#select-invite”)[0].selectize; selectize.clear(); selectize.clearOptions(); selectize.load(function(callback) { callback(inviteList); }); Please note that inviteList should be an array of … Read more

How to get the value of the currently selected Selectize.js input item

Found the problem! For anyone using selectize.js and having problems with the API, try this! If you look at the part of the code where I initialized the selectize.js dropdown, I store the instance in my ‘select’ variable and that’s it. However, this isn’t the proper way to do things (from what I’ve seen at … Read more

How to clear a selected value in Selectize.js dropdown?

I finally found the answer here Selectize.js Demos What works for me is: var $select = $(‘#optionNetFlow’).selectize(); var control = $select[0].selectize; control.clear(); what I was missing var $select = $(‘#optionNetFlow’).selectize(); before applying the solution provided in above question’s answer. Now I am to get all the functions in console like :

How to set a value for a selectize.js input?

Check the API Docs Methods addOption(data) and setValue(value) might be what you are looking for. Update: Seeing the popularity of this answer, here is some additional info based on comments/requests… setValue(value, silent)   Resets the selected items to the given value.   If “silent” is truthy (ie: true, 1), no change event will be fired … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)