Thank you for the reply Tony.I was able to fix this problem.
200-300 records load just fine. It starts to hit the tiomeout
depending on the user after about 1,500 records.
I finally figured out how to add the records all at once as you suggested. This did help
quite a bit, with about a 30% increase in performance. Unfortunately the timeout was
still being triggered on some machines. And since there could be 4,000+ records at
some points, that wouldn't work for me.
So what I did was instead of sending down 1 large javascript call, I broke each row addition
into its own javascript call and then flushed the browser cache. This way each call is only a fraction
of a second and the timeout will never be triggered even if you loaded 50,000 rows. This is
the relevent code:
Bump.
Thank you for the fast response. I removed the comma.
I am a little confused as how to load the data all at once, I am assuming you mean with one call to 'addRowData' instead
of one at a time with a for loop right?
I looked at the link you sent me and it appears that I have the data object in the specified format of
[{name1:value1,name2: value2…}, {name1:value1,name2: value2…} ]
Here is what is in the view source of my page:
|
1 |
<table id="myTable"></table><br /> <div id="gridpager"></div><br /> <script><br /> <br /> jQuery("#myTable").jqGrid({<br /> datatype: "local", <br /> <br /> colNames:['Select','State Number 1', 'State Number 2', 'eHars StNo 1','eHars StNo 2','Match Weight'], <br /> colModel:[ <br /> {name:'Select',index:'Select',sortable:false}, <br /> {name:'StateNumber1',index:'StateNumber1'}, <br /> {name:'StateNumber2',index:'StateNumber2'},<br /> {name:'eHarsStNo1',index:'eHarsStNo1'},<br /> {name:'eHarsStNo2',index:'eHarsStNo2'},<br /> {name:'MatchWeight',index:'MatchWeight'}<br /> <br /> ],<br /> height: "70%",<br /> autowidth: true,<br /> altClass: 'altRow',<br /> altRows: true,<br /> caption: "Click on the first State Number in the pairs of statenos below to combine" <br /> });<br /><br /> var mydata = [ <br /> <br /><br />{Select:"<input type='radio' name='merge' onClick='goToMergeCheck()'/><br /><input type=hidden name=stateNo1 value='0010000697'/><br /><input type=hidden name=stateNo2 value='0010019495'",<br />StateNumber1:"0010000697",StateNumber2:"0010019495",eHarsStNo1:" ",eHarsStNo2:" ",<br />MatchWeight:"2.00"}, <br /><br /><br /></script> |
.............................2,000 repetitions of this....................
|
1 |
{Select:"<input type='radio' name='merge' onClick='goToMergeCheck()'/><br /><input type=hidden name=stateNo1 value='0010022777'/><br /><input type=hidden name=stateNo2 value='0010022587'",StateNumber1:"0010022777",<br />StateNumber2:"0010022587",eHarsStNo1:" ",eHarsStNo2:" ",MatchWeight:"2.00"}, <br /><br /><br /> <br /><br />]; <br /> <br />jQuery("#myTable").jqGrid('addRowData',mydata); <br /><br /><br /><br /><br />I am assuming I am using 'addRowData' incorrectly now but <br />no javascript error is shown. <br />The table is just blank now.<br /><br />Thanks again.<br /><br /><br /> <br /> |
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top