enter image description hereIn "successfunc" the else part should retain the row in editable mode ...
var editparameters= {
"keys": true,
"oneditfunc": function () {
debugger;
$("select#" + arrprimarykey + "_StateName").val(rowData.StateCode);
},
"successfunc": function (data) {
debugger;
var msg = JSON.parse(data.responseText).Message;
var msgType = JSON.parse(data.responseText).MsgType;
if (msgType == "S") {
alert(msg);
$(CityMaster.idGrid).jqGrid('setGridParam', { datatype: 'json' }).trigger('reloadGrid');
} else {
alert(msg)
HERE RESTORE TO INLINE EDITABLE MODE THE ROW ,AGAIN IF ERROR RETURN FROM SERVER
}
},
"url": CityMaster.EditUrl,
"extraparam": {},
"aftersavefunc": function (data) {
debugger;
},
"errorfunc": null,
"afterrestorefunc": function (data) {
debugger;
$(CityMaster.idGrid).jqGrid('setGridParam', { datatype: 'json' }).trigger('reloadGrid');
},
"restoreAfterError": true,
"mtype": "POST"
}
jQuery(CityMaster.idGrid).jqGrid('editRow', arrprimarykey, editparameters);
In "successfunc" the else part should retain the row in editable mode ...
The standard way of reporting the error in jqGrid is setting an error status code of HTTP response. If will force executing of
errorfunc
for example in case of usage inline editing. If the server code unable to set error status code of HTTP response then jqGrid provides an alternative. The callbacksuccessfunc
can be used to examine the response of the server. Thesuccessfunc
should inform jqGrid whether the response is successful of now. The callbacksuccessfunc
should return array[true]
in case of successful response and return array with two elements:[false, "error message to display the user"]
in case of the error. The callbacksuccessfunc
get typically the error message from the response from the server.UPDATED: You should of case use
restoreAfterError: false
(see"restoreAfterError": true
in your current code) to prevent restoring the state of the row before starting inline editing.