I am trying to inline edit with jqgrid, where I am going to call a Spring controller, I need to do extra server side validations. If there are any server validation errors I need to send it back jqgrid via errorfunc, and user notified.
function saveRow(rowId) {
saveparameters = {
"url" : 'editcontroller',
"successfunc" : function( response ) {
alert('success');
return true;
},
"errorfunc": function (reponse) {
alert('error');
return true;
}
};
jQuery('#myGrid').jqGrid('saveRow', rowId, saveparameters);
}
Could someone help me to understand what I have to write in spring controller to send server level validation errors to errorfunc. I Googled but couldn't find concrete example.
Thank you in advance.
In PHP, I just send HTTP header function 500 "Internal Server Error". The errorfunc will catch it automatically.
header (HTTP/ 1.0 500 Error Message)