var postData = $(gridId).jqGrid("getGridParam", "postData");
$.each(paras, function (k, v) {
delete postData[v.name];
});
if (d != null && d.length > 0) {
var pars = {}; $.each(d, function (k, v) { pars[v.name] = v.val; });
$(gridId).jqGrid("setGridParam", { postData: pars }).trigger("reloadGrid");
}
else {
$(gridId).trigger("reloadGrid");
}
原理:每次查询之前先清空,关键一句是:delete postData[v.name];