To reset filters you can modify the postData
parameter of jqGrid directly. You can access it with $("#list").jqGrid('getGridParam','postData')
or $("#list")[0].p.postData
. If a filter is set, the properties of the postData
look like following:
_search true Boolean
nd 1286296925096 Number
page 1 Number
rows 10 Number
searchField "id" String
searchOper "lt" String
searchString "5" String
sidx "id" String
sord "desc" String
To reset the properties you can do following
var postdata = $("#list").jqGrid('getGridParam','postData');
postdata._search = false;
postdata.searchField = "";
postdata.searchOper = "";
postdata.searchString = "";
If you use Advanced Searching instead of Single Searching you should clear filters
property instead of searchField
, searchOper
and searchString
.
At the end you can call $("#list").trigger("reloadGrid",[{page:1}]);
to reload the grid contain starting with the page number 1.