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?
--