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 6822893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:43:03+00:00 2026-05-26T21:43:03+00:00

I have made a dialog and a UI Tab in that dialog. In that

  • 0

I have made a dialog and a UI Tab in that dialog. In that tab i am showing some contents as a table. When i close the dialog by remove() method it closes the dialog but when i reopen it the contents are still showing in the tab, is there any method that contents will also reomve when dialog closes. below is my code.

this.formOrderList = null;
this.orderListDialogObject = $('<div id="mainDiv"></div>');
this.orderListTable = $('<div>'
        + '<table class="ui-widget" width="100%" border="0"  cellspacing="1" cellpadding="2">'
        + '<thead class="ui-widget-header" id="orderListHead">' + '<tr>'
        + '<th><strong> Order# </strong></th>'      
        + '<th><strong> Ref # </strong></th>' + '</tr>' + '</thead>'
        + '<tbody id="orderListBody">' + '</tbody>' + '</table>' + '</div>');
this.orderListTabs = $('<div>' + '<ul>'
        + '<li><a href="#pendingOrderList">Pending</a></li>' + '</ul>'
        + '<div id="pendingOrderList">' + '</div>' + '</div>');

this.show = function() {
    this.orderListDialogObject.dialog({
        title : 'Order List',
        width : 1000,
        height : 150,
        close : function(ev, ui) {              
    $(this).remove();               
            return false;
        }
    });
this.orderListTabs.tabs();
    this.orderListTabs.appendTo(this.orderListDialogObject);        
    $("#pendingOrderList", this.orderListTabs).append(this.orderListTable);
  • 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-26T21:43:04+00:00Added an answer on May 26, 2026 at 9:43 pm

    You’re creating your divs once, and then reusing those same instances repeatedly. Your remove call just removes that div (along with all of its contents) from the DOM tree — you’re not doing anything that will clear the div’s contents.

    You should probably either:

    1. Create a new set of divs each time you show the dialog — i.e., re-run all of the above code each time you want to show the dialog, rather than doing some of it once up-front. That way, you’re starting with a clean slate each time. Or,
    2. Clear the contents of one or more of the divs before you start adding new stuff to it, by calling empty().

    Option #1 would probably be cleaner and easier to maintain in most cases.

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

Sidebar

Related Questions

I have some custom made dialog that have on it Set Button , I
I have made a cart and the cart has remove item button, but the
I have made some code that makes powerpoint and excel work together. And I
I have made a dialog which I am happy with. The problem is that
I have made a dialog that is shown by pressing on a button. I
I have made vectors that contain functions, but they had no argument list. Also,
I have made a custom dialog window that inherits ChildWindow public partial class InputWindow
I have made a jQuery toggle for a menu that I had in mind.
I have made a code that read data from flash Nand (without filesystem). fd
i have made a file open dialog, it contains an edit control whose variable

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.