Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you use jqGrid searching the following two things will be set</p> <ol> <li><code>search</code> parameter of jqGrid will be set to <code>true</code>.</li> <li><code>postData</code> parameter of jqGrid will be modified. The value of the <code>postData</code> parameter is a object which has some properties. In case of <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:singe_searching" rel="noreferrer">single searching</a> the properties <code>searchField</code>, <code>searchString</code> and <code>searchOper</code> will be set. In case of <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:advanced_searching" rel="noreferrer">advanced searching</a> only the property <code>filters</code> of the <code>postData</code> parameter will be set. (The property <code>_search</code> will be also set but from another component of jqGrid, so it is not important for the reset of searching.)</li> </ol> <p>So to reset the searching you can define the following event handler for your "Reset Search" button:</p> <pre><code>$("#resetSearch").click(function() { var grid = $("#list"); grid.jqGrid('setGridParam',{search:false}); var postData = grid.jqGrid('getGridParam','postData'); $.extend(postData,{filters:""}); // for singe search you should replace the line with // $.extend(postData,{searchField:"",searchString:"",searchOper:""}); grid.trigger("reloadGrid",[{page:1}]); }); </code></pre> <p>You can see all this live in <a href="http://www.ok-soft-gmbh.com/jqGrid/ResetSearch.htm" rel="noreferrer">the following demo</a>. In the demo you should first click on the "Search" button of the navigation bar and set a search filter. Then you can click on the "Reset Search" button and reset it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload