Forum


15:39

26/05/2009

Hello,
I am trying to figure out how to do sorting using datatype jsonstring and form editing with multiple select using jqgrid 3.5 beta version.
When the first time the grid loads up the sorting is fine. But after add, edit or delete ( i am using multiple select for delete) the grid soting goes off.
I am using struts 2 to load up the data, edit , add, delete. The server return data in a jsonstring. I do not do any sorting on server side. I want all the sorting on the client side.
I have afterSubmit function
afterSubmit:function reloadGrid(data,postdata){
result = data.responseText.split(":");
if (result[0]=="error") {
return [false,result[1],""];
}
if (result[0]=="ok"){
//alert(result[1]);
jQuery("#incomelist").trigger("reloadGrid");
window.location.href=window.location.href;
return [true,"",""];
}
But the sorting does not seem to work . I have tried mutliple things and read the documentation but I cannot figure out what I am doing wrong that the sorting is going off. I do window.location.href to refresh the page as I have totals which get updated.
I hope someone can help me 🙂
06:06

Moderators
30/10/2007

Hello,
This will not work if you settings reloadAfterSubmit is set to true. It is some task for you why is this happen 🙂 (it is all connected with the way that you call trigger in afterSubmit)
I recommend you to use afterComplete event in form editing to sort the new inserted row - i.e call trigger("reloadGrid") in this event
Regards
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:
38 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