jQuery UI Widgets Forums Dialogs and Notifications Window Content of modal window

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 9 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Content of modal window #60881

    mindgate
    Participant

    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,
    Nikola

    Content of modal window #60927

    Dimitar
    Participant

    Hello 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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Content of modal window #60940

    mindgate
    Participant

    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,
    Nikola

    Content of modal window #60941

    Dimitar
    Participant

    Hi 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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.