$("#jqCategoryGrid").jqGrid({
datatype: "json",
mtype: 'POST',
url: "Webservices/TroubleTicketCategory.asmx/getCategoryData",
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
// **UPDATE - This is the fix, as per Oleg's response**
serializeGridData: function (postData) {
if (postData.searchField === undefined) postData.searchField = null;
if (postData.searchString === undefined) postData.searchString = null;
if (postData.searchOper === undefined) postData.searchOper = null;
//if (postData.filters === undefined) postData.filters = null;
return JSON.stringify(postData);
},
});
问题是jqGrid仍在尝试使用非json格式传递参数,因此我得到了一个错误“invalidjson Primitive”
有没有方法指示jqGrid使用Json序列化数据?
谢谢
我编辑了我的问题中提供的源代码,以包括我使用的修复程序,它来自下面Oleg的回答。