See the Selectize Plugin Docs for general use instructions.
This plugin disables options in a selectize dropdown based on the option's [data-value] attribute. All you need to do is pass in an array of values for the options you want to disable.
$('select').selectize({
plugins: {
'disable_options': {
disableOptions: myArray
},
}
});
Selectize is an extensible jQuery-based custom <select> UI control. It's useful for tagging, contact lists, country selectors, and so on. It clocks in at around ~7kb (gzipped). The goal is to provide a solid & usable experience with a clean and powerful API.