title: jqGrid reload server
body: <p>I have a table filled with data that I want to sort and filter.</p>
  
  <p>I implemented an auto-refresh function, which loads data from the server each time, but I want to restore sort and filter options, which I can do. </p>
  
  <p>I use <code>trigger("reloadGrid",[{current:true}])</code>, setting the datatype to json so that the data are retrieved from the server, in the <code>autorefresh</code> function, and the sort and filter options are used in the <code>loadcomplete</code> method with a <code>setTimeout</code>, as explained in other stackoverflow questions. </p>
  
  <p>That works, but each time the grid refreshes, I see during one second the grid with the full data, not sorted nor filtered, and then the data are locally sorted/filtered. </p>
  
  <p>Given that I want an 5 seconds auto-refresh, is there a way I can prevent the <code>reloadGrid</code> method from displaying the full data when there is a server request but wait for the <code>reload</code> in <code>loadComplete</code> to refresh the display?</p>
  
  <p>Reload used in the <code>autorefresh</code> function :</p>
  
  <pre><code>$("#MyGrid").jqGrid("setGridParam",{url:"list.php", datatype:"json"}).trigger("reloadGrid",[{current:true}]);
  </code></pre>
  
  <p>Model :</p>
  
  <pre><code>jQuery("#MyGrid").jqGrid({
    url:'list.php',  
    datatype: "json",
    loadonce:true,
    ...
    loadComplete: function(){
      if ($("#MyGrid").jqGrid("getGridParam", "datatype") !== "local") {
        setTimeout(function () {
          $("#MyGrid").jqGrid("setGridParam",{search:srch,postData:post});
        })
      };
    }
  </code></pre>