Forum


09:27

24/12/2010

I have 2 fields departDate and arriveDate and in the save of edit/add I need to check the arriveDate is greater then the departDate
I create custom function for the arriveDate field but I didnt know how to get the value of the departDate.
I put the edit button in the gridComplete function:
for(var i=0;i < ids.length;i++){
var cl = ids[i];
be = "<input style='height:22px;width:20px;' type='button' value='E' onclick="jQuery('#"+subgrid_table_id+"').jqGrid('editRow',"+cl+",true,pickdates);" />";
se = "<input style='height:22px;width:20px;' type='button' value='S' onclick="jQuery('#"+subgrid_table_id+"').saveRow('"+cl+"');" />";
ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick="jQuery('#"+subgrid_table_id+"').restoreRow('"+cl+"');" />";
jQuery("#"+subgrid_table_id).jqGrid('setRowData',ids[i],{act:ce+se+be});
}
so the user doesn't need to select the row before he press on the edit so I cant get the select row id and try to take the value from there.
Any solution?
thanks!
14:12

Moderators
30/10/2007

Hello,
I do recommend you to check the dates server side and use the success function to notify the user if the dates are ok.
http://www.trirand.com/jqgridw.....ne_editing
Note that in your case you should use this evenent in both saveRow and editRow
Kind 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:
49 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