I have been using postData
to set the request params dynamically. On click of some external button, I change the grid URL and also set some additional params in postData
like below. JqGrid seems to append all these params and it's data for all the subsequent requests. Is there a way we can control or avoid these params being sent every time?
My grid definition:
jQuery(function() {
$('#grid').jqGrid({
url: 'rates.html',
postData: {
name: function() { return $("#name").val(); },
rate: function() { return $("#rate").val(); },
.....
}
....
});
});
Here in the post request: I see that name
, rate
params are going along with other standard jqGrid parameters like sortname
, sidx
, rows
, etc...
Now if on click of an external button, if I change the grid URL like below
$('#changeReqBtn').click(function() {
$('#grid').setGridParam({ url: 'changeReq.html',
postData: { msgIds: msgIds } });
$('#grid').trigger("reloadGrid");
});
Now jqGrid sends name
, rate, msgIds
params
Now if I change the URL back to rates.html say for example, on click of refresh icon, jqGrid sends the previous msgIds
param and also the previous values. I don't want to send the previous request params in the new request when the URL changes. Is there a way we can achieve this?