Skip to content

Instantly share code, notes, and snippets.

@subhajeet2107
Created July 24, 2017 18:36
Show Gist options
  • Save subhajeet2107/8b19b8bd8c6fff9f6e26c1f8b40d33a9 to your computer and use it in GitHub Desktop.
Save subhajeet2107/8b19b8bd8c6fff9f6e26c1f8b40d33a9 to your computer and use it in GitHub Desktop.
selectize clone fix
$('.selectize').each(function(){
if ($(this)[0].selectize) {
var value = $(this).val(); // store the current value of the select/input
$(this)[0].selectize.destroy(); // destroys selectize()
$(this).val(value); // set back the value of the select/input
}
});
$('.add-role-row-container').append($('.add-role-row')[0].outerHTML);
$('.selectize').each(function(){
if (!$(this)[0].selectize) {
$(this).selectize();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment