jQuery UI Widgets › Forums › General Discussions › Dialogs and Notifications › Window › Content of modal window
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 12 years ago.
-
AuthorContent of modal window Posts
-
Hi there,
I have a web application using modal windows for CRUD implementation of detail records. The DIVs for the modal windows are created once, when the main page loads. They then are reused to show detail content via ajax. Everything works fine, but in some – not really reproducable – circumstances some DOM objects are not removed and hidden fields are fired in forms, they should not be in.
So my question is, if there is a simple way to remove only the content of a modal window from DOM without destroying the modal window itself?
Thanks & greetings,
NikolaHello Nikola,
There is no such direct way. If you are using any jQWidgets components in the modal window’s content, call each one’s destroy methods first, then clear (or update) the content’s HTML via the setContent method.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
thank you for your feedback. The problem is, that the content is generated dynamically for multiple forms. So I would have to destroy dozens of elements. As far as I see it, the solution would be simple, if the content set by setContent would be within a specified DIV of the modal window. Then I could make it empty very simple.
Is it possible to implement this now or in a future release? It’s just a container DIV with a specified ID for the content.
Thanks & greetings,
NikolaHi Nikola,
You can easily empty the content by calling:
$("#jqxwindow").jqxWindow("setContent","");but this would not guarantee some parts of the widgets that were initialized inside (such as pop-ups) or their event bindings would not remain. Therefore, if you do not wish to have “leaks”, you would have to call destroy.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.