JqueryUI destroy dialog without deleting source element?

I use jQueryUI to create a dialog; I want the dialog object to be destroyed when it is deleted.

So, I did something like this:

thisDialog.dialog({
    autoOpen:   true,
    close: function(event, ui) {
        thisDialog.dialog("destroy");
    }
});

What I want to do is to preserve the existence of the element that this Dialog is attached to, but just destroy the jQueryUI object attached to it .dialog(), not change my DOM. p>

Example: http://jsfiddle.net/ytWPV/1/

Update:
Could this be a bug / problem with jQueryUI? If someone can show it, I will also agree with him as an answer

+5
source share
2 answers

, "destroy" "close", , .

( DIV, , CSS: none), html DOM, , ( ), DIV , .html() DIV . HTML , - ...

+1

, , :

$("#win2").clone().attr("id","random").dialog({
    autoOpen:    true,
    height:     60,
    width:         50,
    modal:         true,
    close: function(event, ui) {
        alert($(".hide").html())
        this.dialog("destroy");
    }
});

... .

0

All Articles