It's known, the documentation is kind of generalized for the common widget methods. I'm not sure why exactly it doesn't return its content to the original but some possibilities are: it's complicated, it would require a lot of overhead, minimal use case, ...
For what it's worth, if you call .remove() on a widgets element it will automatically call the widget destroy method. On Tue, Nov 24, 2009 at 5:03 PM, Richard W <[email protected]> wrote: > hi > > i would like to know why .dialog('destroy') does not return the dialog > container to it's original position in the dom? im building an ajax > application and am re-binding the dialog to new html retrieved and > inserted into the dom via ajax. the container ID will be the same in > every case. for example: $('#download-dialog').dialog(); > > when i want to re-bind the dialog after an ajax request, javascript > gets confused as there are now 2 divs with the same id in the dom. > this is because the UI dialog widgets moves the dialog html to the end > of the document. > > from the jquery ui docs, it says using .dialog('destroy') "will return > the element back to its pre-init state". this is not the case for me, > the dialog element remains at the end of the document. > > ofcourse a quick fix in my situation would be something like $ > ("#download-dialog").dialog('destroy').remove(), but i found that > using destroy was misleading, and i had to investigate to figure out > what actually it does. > > i was just wondering if this is intentional or a small oversight? > > -- > > You received this message because you are subscribed to the Google Groups > "jQuery UI" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<jquery-ui%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/jquery-ui?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.
