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

  • Home
  • SEARCH
  • 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 4553486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:57:12+00:00 2026-05-21T16:57:12+00:00

I have a multiselect jqGrid with a multiselect grid-as-subgrid. In the onSelectRow event for

  • 0

I have a multiselect jqGrid with a multiselect grid-as-subgrid. In the onSelectRow event for the parent grid, how can I grab a reference to the child grid?

Essentially, I need to do the following:

  1. Expand the subgrid (so as to load its data from the server)
  2. Get a reference to that subgrid
  3. With the reference, loop through the rows and set each one to selected (For rows which have a nested subgrid of their own, this will trigger their onSelectRow and repeat the process. Don’t worry, the grid is no more than 3 nestings deep.)

I’m looking through the various documentation this morning, but so far haven’t spotted what I need to make this happen. Maybe I’m just missing the obvious? Or maybe this would require a bit more cleverness?

I see how Step 3 above can be accomplished starting with getRowData() and looping through the results with setSelection(). I use those elsewhere in code and they work great. But Steps 1 and 2 above are where I’m stuck at the moment.

Edit: Following @Oleg’s answer below, I looked a bit more into synchronizing efforts between a parent grid’s onSelectRow event and subGridRowExpanded event. Here’s a boiled down version of what I’m testing right now:

onSelectRow: function(id, status) {
  // Automatically expand the sub-grid (to load the data) and select the rows in that grid
  autoSelecting = true; // autoSelecting is a global variable normally set to false
  $('#mainGrid').expandSubGridRow(id);
}
subGridRowExpanded: function(subgrid_id, row_id) {
  //... build the sub-grid, works fine (an artifact of which is a subgrid_table_id)
  // If this grid was auto-expanded to be auto-selected, select all its rows
  if (autoSelecting) {
    var sdata = $('#' + subgrid_table_id).getRowData();
    for (var i = 0; i < sdata.length; i++) {
      $('#' + subgrid_table_id).setSelection(sdata[i].Id);
    }
    autoSelecting = false;
  }
}

A few things are happening here as I tinker with this:

  • If I’m stepping through FireBug to debug this, selections and sub-selections work correctly. However, if I take out breakpoints and try it in real-time, sub-selections don’t happen. The sub-grid expands, but its rows don’t get selected. I figure there’s a timing issue in there somewhere.
  • I haven’t accounted for cascading de-selects yet, clearly.
  • If the sub-grid is already expanded, the selecting doesn’t cascade.
  • 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-21T16:57:13+00:00Added an answer on May 21, 2026 at 4:57 pm

    Inside of loadComplete event handler the grid is loaded and you can do some additional actions like expanding of some rows.

    • You can expand the subgrid with respect of expandSubGridRow method.
    • To get the reference to the subgrid the subgrid should be created first. So the best place to reference of the grid is subGridRowExpanded event. You don’t posted the JavaScript code which you use, so it is difficult to describe all more exactly.
    • To select all rows you can use setSelection in the loop or use code like $('.cbox', myGrid[0]).trigger('click'); There are different other variation how to do the same. If you will see that you have performance bottleneck here then I could describe how you can do the step more effective.

    I can repeat, that the most important that you expand or select the rows after the grid data (or the subgrid data) is loaded.

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

Sidebar

Related Questions

I have a jqGrid with multiselect:true. In a click event of a button I
I have a TListBox with multiselect and ExtendedSelect both set to true. I need
I have a jqGrid in an ASP.NET MVC View with the option multiselect:true .
So I have a MultiSelect box with x values which I need the ability
I have a jqGrid with multiselect. I would like to be able to pre-check
I've implemented my beautiful jqGrid with multiselect rows so I can delete more than
I have the following multiselect control in a Ext JS form which looks like
I have a ListView control that is in FullRowSelect mode, MultiSelect off and using
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have jqGrid 3.5 (full) mostly working. I have it retrieving data with the

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.