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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:56:52+00:00 2026-05-23T01:56:52+00:00

In jQuery there’s an option to set AJAX calls to be synchronous: async: false

  • 0

In jQuery there’s an option to set AJAX calls to be synchronous:

async: false

Is there a way to make this happen in the jqGrid plugin?

Taking a step back, the actual problem I’m trying to solve (and there may be a much better way to do this) is to add an “Expand All” button above a 3-level nested grid structure. My initial approach is simply this:

$('#buttonExpandAll').click(function() {
  // Get all the rows in the top grid
  var rows = $('#mainGrid').getRowData();

  for (var i = 0; i < rows.length; i++) {

    // Expand the sub-grid for this row
    $('#mainGrid').expandSubGridRow(rows[i].Id);

    // Get all the rows for the sub-grid
    //  NOTE: This isn't working because it the data hasn't asynchronously loaded yet
    var subrows = $('#mainGrid_' + rows[i].Id + '_t').getRowData();

    for (var j = 0; j < subrows.length; j++) {

      // Expand the sub-sub-grid for this sub-row
      $('#mainGrid_' + rows[i].Id + '_t').expandSubGridRow(subrows[j].Id);
    }
  }
});

As you can imagine, it expands the first level of nested tables just fine. However, the loop has already terminated before those nested tables get their data from their respective AJAX calls. So the inner loop has no records at the time it’s called.

Is there a clean way to “expand all” on a nested table structure in jqGrid? I realize that making all of the calls synchronous is a performance issue, but at least for now that’s probably not an issue, or at least may be the lesser of two evils.

  • 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-23T01:56:53+00:00Added an answer on May 23, 2026 at 1:56 am

    There are many ajax calls in the jqGrid code. Almost every call has the corresponding ajax opetion which can be used to overwrite any ajax parameter. I suppose that ajaxSubgridOptions jqGrid option in the form

    ajaxSubgridOptions: { async: false }
    

    will solve your problem. If it will not help you can overwrite the setting for all ajax calls:

    $.extend($.jgrid.ajaxOptions, { async: false });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In previous versions of jQuery tabs there was an option to automatically set the
Using javascript/jquery is there a way to set a variable to a default value
In jQuery is there a callback that can be used when an ajax request
Is there a jQuery way to perform iteration over an object's members, such as
Is there a jquery way or plugin to detect the visitor's browser window size
In my JavaScript (using jQuery) there are a whole set of PHP variables to
I am using Jquery - is there a simple way to change the background
I want to hide select itself using jquery if there is no option append
In Jquery there is a regexp patten definition var rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g; this pattern
with jQuery is there a way to say, instead of doc ready, as soon

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.