Skip to content
Browse files

Merge pull request #283 from OlegKi/master

Fixing the performance problem of TreeGrid during expanging or collapsing of nodes having large number of children
  • Loading branch information...
2 parents af9a7da + 752c430 commit 09321837a38ff930ec61d9ef48b14d82daa1b52b @tonytomov tonytomov committed Mar 26, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 js/grid.treegrid.js
View
10 js/grid.treegrid.js
@@ -190,10 +190,11 @@ $.jgrid.extend({
if(!$t.grid || !$t.p.treeGrid) {return;}
var childern = $($t).jqGrid("getNodeChildren",record),
//if ($($t).jqGrid("isVisibleNode",record)) {
- expanded = $t.p.treeReader.expanded_field;
+ expanded = $t.p.treeReader.expanded_field,
+ rows = $t.rows;
$(childern).each(function(){
var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
- $("#"+$.jgrid.jqID(id),$t.grid.bDiv).css("display","");
+ $(rows.namedItem(id)).css("display","");
if(this[expanded]) {
$($t).jqGrid("expandRow",this);
}
@@ -206,10 +207,11 @@ $.jgrid.extend({
var $t = this;
if(!$t.grid || !$t.p.treeGrid) {return;}
var childern = $($t).jqGrid("getNodeChildren",record),
- expanded = $t.p.treeReader.expanded_field;
+ expanded = $t.p.treeReader.expanded_field,
+ rows = $t.rows;
$(childern).each(function(){
var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
- $("#"+$.jgrid.jqID(id),$t.grid.bDiv).css("display","none");
+ $(rows.namedItem(id)).css("display","none");
if(this[expanded]){
$($t).jqGrid("collapseRow",this);
}

0 comments on commit 0932183

Please sign in to comment.
Something went wrong with that request. Please try again.