Forum



19:12

30/08/2010

Hi,
is there a way JqGrid (jsonreader) first get all records (of course) and then in a loop only get, on there server changed records and update them in the Grid? And how, with updateGridRows or addJSONData, ?
By now I do it like that, but this only reloads the Grid in a loop and every time loadComlpete it gets the full Dataset(and there is an Problem when Scroll is=true,then the Grid gets empty while new data is requested):
jQuery(document).ready(function(){jQuery("#list").jqGrid({
url:'test.html',
datatype: "json",
colNames: any,
colModel: any,
rowNum:10,
rowList:[20,50,100],
pager: '#pager',
scroll:true,
loadComplete: function () {setTimeout(function(){
jQuery("#list").jqGrid().trigger("reloadGrid", [{current:true}]);
return false;}, 1000);
},
loadError: function () {setTimeout(function(){
jQuery("#list").jqGrid().trigger("reloadGrid", [{current:true}]);
return false;}, 15000);
},
caption: "any",
viewrecords: true,
gridview: true,
height: any,
width: any,
loadui:"disabled",});
jQuery("#list").jqGrid('navGrid','#list_pager',{search:true,add:false,edit:false,del:false});
});
THX
JAY
16:59

30/08/2010

Server-Side is ready.
the json url call first returns the full set of rows:
{"userdata": 1289918647843, "total": 2, "rows": [{"cell": ["1", "None", "8", "yes", "ddddddd", "ddddddddddddddddd", "dddddddddddddddd", "ddddddddddddddddddddd", "True", "True", "ddddddddddddddd", "9999999999999"], "id": 1}, {"cell": ["2", "", "0", "test", "jjjjjjjjjjjjj", "jjjjjjjjjjjjjjj", "jjjjjjjjjjjjjjjjj", "jjjjjjjjjjjjjjjjjjjjjjjjj", "True", "True", "jjjjjjjjjj", "None"], "id": 2}, {"cell": ["3", "", "3", "test", "", "", "", "", "False", "False", "", "None"], "id": 3}, {"cell": ["4", "", "None", "ddd", "", "", "", "", "False", "False", "", "None"], "id": 4}, {"cell": ["5", "", "None", "fffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "", "", "", "", "False", "False", "", "None"], "id": 5}, {"cell": ["6", "", "None", "alt2", "", "", "", "", "False", "False", "", "None"], "id": 6}, {"cell": ["7", "", "None", "hure", "", "", "", "", "False", "False", "", "None"], "id": 7}, {"cell": ["8", "", "None", "8", "", "", "", "", "False", "False", "", "None"], "id": 8}, {"cell": ["9", "", "None", "8888", "", "", "", "", "False", "False", "", "None"], "id": 9}, {"cell": ["10", "", "None", "10", "", "", "", "", "False", "False", "", "None"], "id": 10}], "page": 1, "records": 13}
and after that it returns timestamp filtered results( To be updated in the Grid):
{"userdata": 1289919036281, "total": 1, "rows": [{"cell": ["1", "None", "newvalue", "newvalue", "ddddddd", "ddddddddddddddddd", "dddddddddddddddd", "ddddddddddddddddddddd", "True", "True", "ddddddddddddddd", "9999999999999"], "id": 1}, {"cell": ["13", "", "None", "newvalue", "", "", "", "", "False", "False", "", "9999999999999"], "id": 9}], "page": 1, "records": 2}
I need to know, how to update the Rows with every json url call, while keeping the first result. Is there any Solution for that?
Thanks.
JAY
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