Permalink
Browse files

Setting up treeGrid to load enough data

  • Loading branch information...
1 parent 0e9450c commit cab6109f482bc824013c3ac51d148f3da282d33d @tonytomov committed Jul 8, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 js/grid.treegrid.js
View
@@ -132,6 +132,7 @@ $.jgrid.extend({
$t.p.subGrid = false;$t.p.altRows =false;
$t.p.pgbuttons = false;$t.p.pginput = false;
$t.p.gridview = true;
+ if($t.p.rowTotal === null ) { $t.p.rowNum = 10000; }
$t.p.multiselect = false;$t.p.rowList = [];
$t.p.expColInd = 0;
pico = 'ui-icon-triangle-1-' + ($t.p.direction=="rtl" ? 'w' : 'e');

3 comments on commit cab6109

Contributor

OlegKi replied Jul 8, 2011

I am not sure Tony, that the change will ever work, because of the line which set the default value of rowNum to 20.

Best regards
Oleg

Owner

tonytomov replied Jul 9, 2011

What is the problem? The setTreeGGid is called around line 2006. The real problem is if the developer want to load exactly certain number of records.
In this case this will be not possible... Will think how to overcome this, maybe the better solution is to use rowTotal parameter

Contributor

OlegKi replied Jul 10, 2011

What I mean Tony is that the current implementation of Tree Grid does not support data paging. In the case the default setting of rowNum to 20 are very misunderstanding. If the user not set the value explicitly to some large enough value the default value 20 for rowNum will be applied. In the case the loaded tree data will be just cut somewhere in the middle without any warnings or errors. Look at the demo and compare it with the another demo where the rowNum will be explicitly set.

I suggest to use the code $t.p.rowNum = 10000; without any condition till one implements the paging in the tree grid code.

Best regards
Oleg

Please sign in to comment.