Forum
23:15
20/12/2010
Hi,
I am using jqgrid for loading huge table of datas, thousands of rows. But for better performance I wand to load this huge table only one time - when site is loaded, and then periodic check server for newly added records after user load this huge table, but only this new records, not all, and then merge first time loaded json object with newly loaded records.
So i modyfi grid.base.js file:
2line around 589 before this:
add this:
2line around 688 before this:
add this:
2line around 1180 before this:
add this:
2line around 1630 (after edit previous it can by different) before this:
add this:
Ok, adding done, now edit your setup:
in your jqgrid set up new option "dataUpdateJSON" to true - default is false; true enable this little trick
set up option loadComplete to function witch will call your custom reload grid function, example: reload_grid();
sample:
var grid_reload;
var grid_reload_time = 3000;
function reload_grid()
{
clearInterval(grid_reload);
grid_reload = setInterval(function()
{
var mygrid = jQuery("#grid")[0];
$.ajax( url:"your ajax url",
type:"POST",
dataType: "json" ,
data: "your data to server",
success:function(data,st)
{
mygrid.mergeJSONData(data);
});
},grid_reload_time);
};
WARNING: I test this only with my configuration:
loadonce: true,
rowTotal: -1,
datatype: "json",
and for now I dont have writed script code for merge two datas objects, but you can write yourself. I will post one ASAP.
So i hope that this is good idea.
Most Users Ever Online: 715
Currently Online:
104 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