Disabling selectize dropdown when a checkbox is checked
javascript, jquery, selectize.js
Solution
I wanted to add an additional answer here because although @tclark333's answer is correct, it's a bit misleading since the first line is the actual initialization of the selectize object, and not actually what's needed for the answer.
The selectize API is exposed when you access the selectize property on the underlying element from a jQuery object and not as an extension to jQuery itself.
Assuming the element that has been selectized's ID is "myDropDown":
//disable
$('#myDropDown')[0].selectize.disable();
//re-enable
$('#myDropDown')[0].selectize.enable();
Problem
I have implemented Selectize on my HTML form. However a dropdown only becomes active when the "enable" checkbox is clicked. I know there is a `disable` property on the Selectize object but I dont know how to use it when the checkbox is clicked. I have tried adding the `disabled` class to the Selectize `div` element but that does not work either. Any help will be well appreciated. Thanks