I am having a bit of a problem with this fantastic jqgrid plugin and my attempt to use it with WCF Data Services (not really, but the very similar odata4j services). By the
There are no loadBeforeSend
parameter which you can set by $.jgrid.edit
. The values from $.jgrid.edit
defines default options of editGridRow.
To specify the loadBeforeSend
callback which should be used during the corresponding Ajax request you should use ajaxEditOptions
instead and specify beforeSend
(see $.ajax):
$.extend($.jgrid.edit, {
closeAfterEdit: true,
closeAfterAdd: true,
ajaxEditOptions: {
contentType: "application/json",
beforeSend: function (jqXHR, settings) {
jqXHR.setRequestHeader("X-HTTP-Method", "MERGE");
}
},
//mtype: 'POST', - it's already default
serializeEditData: function (data) {
delete data.oper;
return JSON.stringify(data);
}
});