Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6342543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:15:39+00:00 2026-05-24T20:15:39+00:00

I get that when developing a jQuery UI widget one must override destroy and

  • 0

I get that when developing a jQuery UI widget one must override destroy and call super.destroy or destroy on any nested widgets. But when is/should destroy be called? Is it ever being called auto-magically by jQueryUI framework? Or should it be called by a client programmer (using my awesome widget)?

For example, say I have a lightbox (fancybox) that displays an accordion(). Say the accordion is being created in fancybox’ onStart callback – as the lightbox is about to be displayed.
Should accordion(‘destroy’) be called in ‘on-lightbox-close’ callback? Seems unnecessary…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:15:41+00:00Added an answer on May 24, 2026 at 8:15 pm

    destroy is called by you when you want to destroy the widget.

    It is also called by UI when you .remove() an element from the DOM which had been “widgetized.”

    As for your specific use case, it depends. Will the same lightbox instance be re-opened at any point in the future of that page-load’s lifetime? If so, destroying would only add overhead as the next showing of the lightbox would require a “re-widgetization”. If not, then not destroying would leave memory being taken up for no reason. (this assumes that the close of your lightbox does not cause the elements to be removed from the DOM)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What are profound advantages that one get when using COM for developing components over
I am developing a poll using ruby, but the answer that i get is
I'm developing a javascript widget that depends on jQuery. The widget may or may
I get that the (nolock) optimizer hint allows for dirty reads, but under what
I get that asterix is for pointers, and I understand about pointers now. But
How may one get information that was used to programatically generate asp controls? For
I am developing a comments box that will save the comment through a JQuery
I am developing an asp.net mvc web application that makes much use of jquery
I have a widget in an ASP.NET project that I'm developing for my job.
I'm developing a jQuery plug-in that will be a connector for some REST API.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.