Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your main error is the usage of the <code>postData</code> parameter in the form:</p> <pre><code>postData: $("#myForm").serialize() </code></pre> <p>This usage has two problems:</p> <ol> <li>The value <code>$("#myForm").serialize()</code> overwrite all parameters of the POST requests instead of the adding additional parameters.</li> <li>The value <code>$("#myForm").serialize()</code> will be calculated <strong>only once</strong> during the grid initialization time. So you will send always <code>search=""</code> and <code>maxPrice=""</code> to the server.</li> </ol> <p>I suggest you to to replace the form with named edit fields to</p> <pre><code>&lt;fieldset&gt; &lt;input type='text' id='search' /&gt; &lt;input type='text' id='maxPrice' /&gt; &lt;button type='button' id='startSearch'&gt;Search&lt;/button&gt; &lt;/fieldset&gt; </code></pre> <p>define <code>postData</code> parameter as object with methods:</p> <pre><code>postData: { search: function() { return $("#search").val(); }, maxPrice: function() { return $("#maxPrice").val(); }, }, </code></pre> <p>and add <code>onclick</code> event handler to the "Search" button (see above HTML fragment)</p> <pre><code>$("#startSearch").click(function() { $("#myGrid").trigger("reloadGrid"); }); </code></pre> <p>Moreover you write nothing about the server technology which you use. It can be some additional modification is required to be able to read parameters on the server side (for example <code>serializeRowData: function (data) {return JSON.stringify(data);}</code> see <a href="https://stackoverflow.com/questions/3917102/jqgrid-add-row-and-send-data-to-webservice-for-insert/3918615#3918615">this</a> and <a href="https://stackoverflow.com/questions/3912008/jqgrid-does-not-populate-with-data/3914796#3914796">this</a>). I recommend you also to read another old answer: <a href="https://stackoverflow.com/questions/2928371/how-to-filter-the-jqgrid-data-not-using-the-built-in-search-filter-box/2928819#2928819">How to filter the jqGrid data NOT using the built in search/filter box</a>.</p> <p>Some other small errors like <code>'/Products/Search") %&gt;'</code> instead of '/Products/Search' or the usage of deprecated parameter <code>imgpath</code> (see <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:upgrade_from_3.4.x_to_3.5#options" rel="nofollow noreferrer">documentation</a>) are less important. The default column options like <code>align: 'left'</code> should be better removed.</p> <p>Consider also to use searching in the grid. For example <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:advanced_searching" rel="nofollow noreferrer">advance searching</a></p> <pre><code>$("#myGrid").jqGrid('navGrid','#pager', {add:false,edit:false,del:false,search:true,refresh:true}, {},{},{},{multipleSearch:true}); </code></pre> <p>and also <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:toolbar_searching" rel="nofollow noreferrer">toolbar searching</a>:</p> <pre><code>$("#myGrid").jqGrid('filterToolbar', {stringResult:true,searchOnEnter:true,defaultSearch:"cn"}); </code></pre> <p>it can probably replace the searching form which you use.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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