How to undo or destroy dropdown keeping original select? For example if I have a regular <select> with options and I call $('select').dropdown(), then how can I revert back to the standard <select>? I'm asking because calling the dropdown function wraps a bunch of code and I need to re-render it with new options
There are mutation observers to watch the original select and update the menu when the select options change. You can also call refresh menu.
jQuery Hack;
$.fn.destroyDropdown = function() {
return $(this).each(function() {
$(this).parent().dropdown( 'destroy' ).replaceWith( $(this) );
});
};
$('select').destroyDropdown();
jQuery Hack;
$.fn.destroyDropdown = function() { return $(this).each(function() { $(this).parent().dropdown( 'destroy' ).replaceWith( $(this) ); }); };$('select').destroyDropdown();
Not have Behavior destroy...