I use the selectize.js with remove-button Plugin. I fill the options dynmaicly based on Users decisions. By Buttonclick i add a new Option.
$('#saveItem').click(function(){
data = [{item: 'newItem', nr: 'R005'}];
var selectize = $item[0].selectize;
selectize.addOption(data);
selectize.addItem(data);
selectize.refreshOptions();
});
When the user now select the option from the list and later he removes the option from the Inputfield than the option is gone.
Only my inital options are in the optionlist. How can i store the dynamic generated options?
I have a fiddle. There can u see that I get a "Option" newItem by button Click. But when i select and then remove them the "Option" is'nt longer in the option list. Where is my fault?