title: jqgrid - refresh a grid after an ajax file upload
body: <p>How would I refresh a jqgrid based grid from outside of the grid itself? Within the code for a grid exists the option to call <code>reloadGrid</code>. However, I want to reload the grid after doing an ajax file upload, outside of the jqgrid code. How could I call <code>reloadGrid</code> in that context?</p>
  
  <p>I realize I can completely reload the entire page with something like: <code>location.reload();</code> but that reloads the whole lot and puts me back to the first page of results for a grid and kind of defeats the purpose of using ajax to upload a file in the first place.</p>
  
  <p><strong>Some code:</strong></p>
  
  <p>reloadGrid is called from within jqgrid as follows:</p>
  
  <p><code>$("#thegrid").trigger("reloadGrid");</code></p>
  
  <p>but it does nothing when called from within my ajaxupload:</p>
  
  <pre><code>        onComplete: function(file, response) {
              if (response == 'success') {
                          //location.reload();
                          $("#thegrid").trigger("reloadGrid");
                      }else if (response == 'error') {
                          alert("Doh!");
                      }
  </code></pre>
  
  <p>If I uncomment <code>location.reload()</code>, the page reloads but with the trigger uncommented (as in the above example) nothing happens at all. So how do I reload this grid?</p>