How To Fully Destroy jQuery UI Dialog Boxes

Published Date Author: , Posted July 11th, 2011 at 11:26:33am

I was having issues with jQuery UI dialogs being hidden and not fully removed. Had same issues with both native dialog and the dialogwrapper plugin.
The following code would hide, but not fully remove the div, for whatever reason:

1
jQuery(this).dialog('destroy');
jQuery(this).dialog('destroy');

So this is what I used instead:

1
jQuery('#'+this.id).remove();
jQuery('#'+this.id).remove();

!! UPDATE:

After being coached by the dialogWrapper author, I am using the following to just auto-close the top-most dialog, which is all I care about for my application:

1
jQuery.destroyDialog();
jQuery.destroyDialog();

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.