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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:51:24+00:00 2026-06-15T19:51:24+00:00

I have a JQuery Dialog which has beforeclose handler method that refreshes the parent

  • 0

I have a JQuery Dialog which has beforeclose handler method that refreshes the parent window:

$( "#dialog" ).dialog({
    beforeclose: function(event, ui) { 
       refreshParent(); 
    } 
});

The dialog once opened, can be closed from multiple location. Each time the dialog is closed, the refreshParent() method is called.

Now I need to check whether in certain conditions if dialog is closed, the refreshParent() should not be called.

One way of doing this would be to put a global flag like below:

$( "#dialog" ).dialog({
    beforeclose: function(event, ui) { 
       if(doRefreshParent)
           refreshParent(); 
    } 
});

And set doRefreshParent to true or false before calling dialog close. But this does not seem to be a good approach.

Is there any way we can check within beforeclose handler from where the dialog close got called(i.e the id of the element that got clicked, because of which dialog close happened). So that we can then control the invocation of refreshParent().

  • 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-06-15T19:51:25+00:00Added an answer on June 15, 2026 at 7:51 pm

    For recognition of the parent element, you can simply use a class to differentiate.
    A simple effect method. You can find a live example

    The main dialog configuration::

    jQuery("#dialog").dialog({
        autoOpen: false,
    
        modal: true,
    
        open: function() {
    
            var id = $('.parentelement').attr('id');
            $("#dialog").html("The parent id is::"+id);
            //alert("the id is:" + id);          
        },
         close: function(){
                $('.parentelement').removeClass('parentelement'); 
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a textarea element inside of a jquery modal dialog that has an
I want to raise a jQuery Dialog box which has 2 buttons. So that
I have a JQUERY based dialog box, which has a 'select' on it. When
I have a JQuery UI dialog which is modal and has a black background
Okay I have a jQuery dialog box which has a form in it and
I have a jquery-ui-dialog that contains a <form> which contains a <input type=file >
I have a simple search form which launches a jQuery UI dialog that contains
I have a jQuery dialog which loads an external php page. All is working
I have a jQuery dialog that appears and loads an external page. In that
When creating or editing object sin my table, I have a jquery dialog that

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.