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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:31:35+00:00 2026-06-06T01:31:35+00:00

I have a jqGrid loaded by AJAX inside a jQuery UI Dialog. Everything is

  • 0

I have a jqGrid loaded by AJAX inside a jQuery UI Dialog. Everything is working fine, except the Dialog which is not closing. When I click in both buttons, it reaches the alerts, but the Dialog is not being closed.

buttons: {
    'Confirm': function() {
        alert('OK Confirm');
        $('#test-grid').dialog('close');
    },
    'Cancelar': function() {
        alert('OK Cancel');
        $(this).dialog('close');
    }
}

I’ve tried with $('#test-grid').dialog('close') and $(this).dialog('close'), but no one works. If I remove the jqGrid loaded by AJAX, everything works fine.
The error console on Firefox and Chrome is empty.

I’m loading the jqGrid page with:

$('#test-grid').load('/grid').dialog('open');

Can anyone help me?

UPDATE

I’ve tried to load a simple HTML snippet using AJAX and the problem persists.

  • 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-06T01:31:38+00:00Added an answer on June 6, 2026 at 1:31 am

    The problem is that the call to load is interfering with the call to open the dialog. You can fix this by loading the AJAX content into a child element of test-grid. For example:

     $('#test-grid-child').load('/grid');
     $('#test-grid').dialog('open');
    

    Update

    I just read the docs for load and gave this a bit more thought. What is happening is that when the code $('#test-grid').load('/grid').dialog('open'); is executed, an AJAX request is started and the dialog is created immediately. But once the load‘s AJAX request finishes, jQuery comes back and overwrites the contents of #test-grid. This explains why the dialog could not be closed, because the underlying markup is modified out from underneath the dialog object.

    Retrieving data to a child element eliminates this problem since load and dialog each now manipulates a different section of the DOM.

    Note that if the AJAX request takes a long time to complete, you might want to consider implementing a complete function to give feedback to the user – maybe by displaying a spinner until the data is ready. For example:

    $('#test-grid-child').load('ajax/test.html', function() {
      alert('Load was performed.'); // Perform any necessary UI action here
    });
    

    Anyway, more information than you probably needed, but I just wanted to update this question while it was still fresh in my mind…

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

Sidebar

Related Questions

I have this code just to send data from already loaded jqGrid: jQuery(#bedata).click(function(){ //Function
I have a jqGrid that's working 100% except that it keeps displaying undefined in
We've built an AJAX website which uses JQuery UI extensively. we have 30+ homemade
I have four jqgrid in my jsp application. They are loaded via ajax using
I have a checkbox column in my JqGrid which get loaded from DB, so
I have jqGrid 3.5 (full) mostly working. I have it retrieving data with the
I have a jqgrid with the add dialog enabled for adding new rows. The
I have a jqGrid on a page and users can click a button to
I have a jqGrid with which users will select records. A large number of
I have a jqGrid in grouping mode that works fine on initial load. However,

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.