jQWidgets Forums

jQuery UI Widgets Forums General Discussions jQWidget does not clean up dom on unload

This topic contains 7 replies, has 3 voices, and was last updated by  gvv 12 years, 7 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • jQWidget does not clean up dom on unload #7111

    I am currently using jqWindow, jqTab and jqExpander Widget. They are great, but it seems that if one manually closes one of this widgets it is not possible to restore them unless the page is completely reloaded. Does jQWidget clean up correctly the DOM once the functionality is closed ? Actually, I need to do it manually which is quite annoying.

    Thank you for you help.

    jQWidget does not clean up dom on unload #7112

    Peter Stoev
    Keymaster

    Hi stefan.r.meier,

    Our widgets are jQuery-based client-side widgets and are built once the DOM is loaded. When you close the web page and reopen it, widgets will be initialized again as the DOM will be loaded again.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jQWidget does not clean up dom on unload #7113

    Hi Peter,

    Thank you for your reply.

    My application is a Single Page Application and the DOM is never completely reloaded. So if one closes a widget, it should be possible to reopen it again. That’s the reason of my question concerning unloading.

    Best regards,
    Stefan

    jQWidget does not clean up dom on unload #7114

    Peter Stoev
    Keymaster

    Hi Stefan,

    What do you mean by closing a widget? Clicking the jqxWindow’s close button or something else? If that’s what you mean, to open the window again, use its ‘open’ method. If you don’t reload your page, make sure that you initialize the widgets just once.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jQWidget does not clean up dom on unload #7115

    Hi Peter,

    Thank you for your reply.

    By closing a widget I mean clicking on the close button. I will try to reopen it with the open method as you suggest. Is there no possibility to remove completely a widget and to restore it when it is needed again. If all widgets are kept on the page, the DOM becomes too overloaded.

    Best regards,
    Stefan

    jQWidget does not clean up dom on unload #7116

    Peter Stoev
    Keymaster

    Hi Stefan,

    To remove a widget from the DOM, use the jQuery’s remove method. To add a widget again, create a DIV tag dynamically, append it to the document’s body by using the jQuery’s append method and initialize the widget by selecting the DIV tag by ID and calling the widget’s constructor.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jQWidget does not clean up dom on unload #7117

    Hi Peter,

    I will try this again.

    Best regards,
    Stefan

    jQWidget does not clean up dom on unload #9182

    gvv
    Member

    try

    $(“#selector”).removeData(“jqxWidget”);

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

You must be logged in to reply to this topic.