title: Timing of gridComplete event with Trirand's jqGrid
body: <p>I'm not convinced that the gridComplete event runs "after all the data is loaded into the grid and all other processes are complete," as specified in the <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3aevents" rel="nofollow">documentation</a>.  </p>
  
  <p>I've got a grid that is loading correctly.  In the gidComplete event, I'm triggering some filtering methods (.extend and .setGridParam) to apply a filter as soon as the grid is loaded.  However, although my custom function is firing (seen through console), the filter is not being applied.  If I use the setTimeout to delay the execution by a second (or so), then the filter is, in fact, applied.  So it seems to me that the gridComplete is firing too early.  </p>
  
  <p>Incidentally, the filter function (called setGridFilter()) also fires in an onchange event bound to a select menu (where the user can choose from pre-set filter options).  This works perfectly.  It's just the gridComplete invocation of this function that is failing.</p>
  
  <pre><code>$("#list3").jqGrid({
     url: 'blah.php',
     colNames: ['blah1','blah2','etc.','PresentationTemplateID'],
     colModel: [name: 'blah1', index: 'blah1'],
         [name: 'blah2', index: 'blah2'],
         [name: 'etc.', index: 'etc.'],
         [name: 'PresentationTemplateID', index: 'PresentationTemplateID', hidden:true]
     viewRecords:true,
     loadonce: true,
     pager: '#pager3',
     search:true,
     gridComplete: function(){
         //var t = setTimeout('setGridFilter()',1000);   //this works, for some reason
         setGridFilter();  //this does not
     }
  });
  
  function setGridFilter() {
     var postdata = $("#list3").jqGrid('getGridParam','postData');
     var text = $("#ddlGridFilterMenu").val(), f;
     $.extend(postdata,{filters:'',searchField: 'PresentationTemplateID', searchOper: 'eq', searchString: text});
     $("#list3").jqGrid('setGridParam', { search: text.length&gt;0, postData: postdata });
     $("#list3").trigger("reloadGrid",[{page:1}]);
  }
  </code></pre>