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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:31:19+00:00 2026-05-30T20:31:19+00:00

I am using jqgrid treegrid to load the data remotely on expand event. It

  • 0

I am using jqgrid treegrid to load the data remotely on expand event. It is retrieving the data fast but it is taking time to load on client side and also on collapsing the node, it is giving stop script error on IE8. On FF and Chrome, it does take time but works with out any script errors. I only have 480 records to display but treegrid shows huge performance drawback. IE8 error on collapsing FEB-2012 node…

enter image description here

  • 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-30T20:31:20+00:00Added an answer on May 30, 2026 at 8:31 pm

    I tested your demo and I have one tip hot to improve the performance dramatically. The reason are the line inside of expandRow:

    $("#"+id,$t.grid.bDiv).css("display","");
    

    and another line inside of collapseRow:

    $("#"+id,$t.grid.bDiv).css("display","none");
    

    The lines uses $t.grid.bDiv as the jQuery context parameter. It follows that the data from $t.grid.bDiv fill be searched without using the index existing for ids. In case of the grid has no id duplicates (which would be a bug in the data) one can remove the $t.grid.bDiv parameter

    The demo is identical to your original demo, but I used the fixed code of the function where the above lines are replaced to

    $("#"+$.jgrid.jqID(id)).css("display","");
    

    and

    $("#"+$.jgrid.jqID(id)).css("display","none");
    

    I used the original jqGrid 4.1.1 jquery.jqGrid.min.js, but overwrote the code only the expandRow and collapseRow function with

    $.jgrid.extend({
        expandRow: function (record){
            this.each(function(){
                var $t = this;
                if(!$t.grid || !$t.p.treeGrid) {return;}
                var childern = $($t).jqGrid("getNodeChildren",record),
                //if ($($t).jqGrid("isVisibleNode",record)) {
                expanded = $t.p.treeReader.expanded_field;
                $(childern).each(function(i){
                    var id  = $.jgrid.getAccessor(this,$t.p.localReader.id);
                    //$("#"+id,$t.grid.bDiv).css("display","");
                    $("#"+$.jgrid.jqID(id)).css("display","");
                    if(this[expanded]) {
                        $($t).jqGrid("expandRow",this);
                    }
                });
                //}
            });
        },
        collapseRow : function (record) {
            this.each(function(){
                var $t = this;
                if(!$t.grid || !$t.p.treeGrid) {return;}
                var childern = $($t).jqGrid("getNodeChildren",record),
                expanded = $t.p.treeReader.expanded_field;
                $(childern).each(function(i){
                    var id  = $.jgrid.getAccessor(this,$t.p.localReader.id);
                    //$("#"+id,$t.grid.bDiv).css("display","none");
                    $("#"+$.jgrid.jqID(id)).css("display","none");
                    if(this[expanded]){
                        $($t).jqGrid("collapseRow",this);
                    }
                });
            });
        }
    });
    

    I think that one can more improve performance of the code, but at least the simple change can improve dramatically the performance of collapsing or expanding of tree nodes having many items.

    UPDATED: I posted just now the pull request which fix the described above problem in the main code of jqGrid. I decided to use $($t.rows.namedItem(id)) instead of described above $(“#”+$.jgrid.jqID(id)). I didn’t measure the performance exactly, but the usage of namedItem should be the most close to the original jqGrid code and I hope it works a little more quickly as id selector of jQuery.

    UPDATED 2: The fix is now in the main code of jqGrid on the github (see here)

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

Sidebar

Related Questions

I am having trouble constructing a jqGrid TreeGrid using local data. This method works
I am using a jqgrid's treegrid and the data for the child nodes is
I am using JQGrid in my solution in which i load tabs dynamically, but
I'm using jqGrid and adding my own onclick event to each cell of data
I am using jqGrid ( http://www.trirand.com/blog/ ) to display some read-only data. The resizeable
I am using jqGrid to render some data. Now I want the ability to
jqGrid tree nodes are read from server using json data. Click in node reads
Hi I'm using jqgrid to show some information in a grid. But I have
I am using jqgrid with local data and I know how to edit a
I am using jqGrid , but it cannot take attributes from a xml file.

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.