Forum


13:14

09/02/2010

Hello,
We still use jqGrid v. 3.6.2 and cannot upgrade easily since we did some custom code mods, however I'd like to know whether the following is a behavior, a bug, or some misunderstanding from me.
Server-side, I've put the "required:true" in colModel editrules for a mandatory field.
When clicking on an edit inline button to save a new row, the javascript code I run is the following :
$('#WEBCONT___Row1__Cell0WL2').saveRow('1', false, 'clientArray');
callSaveList('ListUserInstitution','WEBCONT___Row1__Cell0WL2','1');
nanoNewRow('WEBCONT___Row1__Cell0WL2', '1','W3sidXNlcl9pZCI6IjEwIn1d');
saveRow() performs the fields check and since a mandatory field isn't filled in (I save a new empty row) I get a modal dialog complaining about it. It's ok but what bugs me is that the callSaveList() ajax call is made despites it shouldn't (data is considered incorrect and should not be sent to server).
This wiki page doesn't deal with my test case :
http://www.trirand.com/jqgridw.....;s=saverow
saveRow() returns the elements it deals with (dom element, "return this.each(function(){ ...") instead of true/false which I could then use to decide to save or not the data.
Is there a bug or a lack of documentation that would confuse me ? Thanks for your feedback and my apologies for dealing with jqGrid 3.6.2.
Barbara
21:31

Moderators
30/10/2007

Hello,
When we save the data locally as in your case this have sense, but when we save the data with ajax it is difficult to determine what to return since the method is executed and the ajax call continnue his execution and we do not know what to return.
I recommen you to put
callSaveList in aftersavefunc in order to resolve this problem
Best 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.
10:26

09/02/2010

Hello,
OK I understand what you mean and am trying to modify my code to do it this way.
Since I post to 'clientArray', the aftersavefunc is called with two arguments, the first being the row id, the second "true".
How can I get my jqGrid id in the aftersavefunc ? I need it to be passed to my ajax server call the aftersavefunc does.
I also have a problem with some specific data (some reference values related to the page that contains one or several jqGrids) I know the value of this data when I execute saveRow, but I cannot pass its value to the aftersavefunc. How can I do it ?
I don't know why we chose to post to 'clientArray' but I guess this is related to the specific data we get here and there (they're computed server-side when we generate the javascript) and that are needed to make the save ajax call (contextual information).
Thank you for your input.
Barbara
Most Users Ever Online: 715
Currently Online:
28 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