jqgrid postData setGridParam 调用多次时查询条件累加的问题

 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];

你可能感兴趣的:(jqGrid)