Forum


06:59

07/06/2009

I have been doing some testing with large grids (45 columns and 1000 rows) and overall the performance is very good given the volume of data. However, there is some slowness when changing between rows. With a little profiling/debugging it appears that two things are contributing to the slowness:
1) scrollrows – if the scrollrows property is set to true this seems to add quite a bit of time to the amount of time it takes to switch rows. Not sure if anything can be done about this, but for my code i just turn off scrollrows when the grid gets bigger than 100 rows
2) also in set selection there seems to be quite a bit of overhead for selecting the checkbox. At least with IE. I didn't test to see if the same overhead existing in firefox. I made a slight change that seems to remove most of the overhead (old code in green commented out. the change is in bold). I beleive the change is correct, but i am not as familiar with the innerworkings of the grid, so i may be wrong.
Even with these changes the switch of rows seems a bit slow, but it is definitely manageable. If any has done similar testing and has any performance improvements/tips that they can pass along, it would be greatly appreciated.
setSelection : function(selection,onsr) {
…
if( ia === -1 ){
if($(pt).attr(“class”) !== “subgrid”) { $(pt).addClass(“ui-state-highlight”).attr(“aria-selected”,“true”);}
stat =
true ;
// change – start – performance improvement for large grids
$(
“#jqg_”+$t.p.selrow.replace(“.”, “\\\\.”),pt).attr(“checked”,stat);
//$(”#jqg_”+$t.p.selrow.replace(”.”, “\\\\.”),$t.rows).attr(”checked”,stat);
// change – end
$t.p.selarrrow.push($t.p.selrow);
if( $t.p.onSelectRow && onsr) { $t.p.onSelectRow($t.p.selrow, stat); }
}
else
{
if($(pt).attr(“class”) !== “subgrid”) { $(pt).removeClass(“ui-state-highlight”).attr(“aria-selected”,“false”);}
stat =
false ;
// change – start – performance improvement for large grid
$(
“#jqg_”+$t.p.selrow.replace(“.”, “\\\\.”),pt).attr(“checked”,stat);
//$(”#jqg_”+$t.p.selrow.replace(”.”, “\\\\.”),$t.rows).attr(”checked”,stat);
// change – end
$t.p.selarrrow.splice(ia,1);
11:34

Moderators
30/10/2007

Hello,
Thanks. Definitley I will check this and if it is ok, will include the fix.
Best Regds
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
48 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66