Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, the statement <code>$("#jqGridElement").trigger('GridUnload')</code> do nothing because there are no event with the name <code>'GridUnload'</code>. The only event currently supported by jqGrid is <code>'reloadGrid'</code>. The event support additional parameters (see <a href="https://stackoverflow.com/questions/3807623/jqgrid-paging-question/3808014#3808014">here</a>) which can be interesting for you. The call <code>$("#jqGridElement").trigger("reloadGrid", [{current:true}]);</code> will refresh the grid, but the selection which could make the user will be not changed.</p> <p>If you need call <code>GridUnload</code> in "new style API" it should looks like</p> <pre><code>$("#jqGridElement").jqGrid('GridUnload'); </code></pre> <p>After you call <code>GridUnload</code> method the <code>table</code> element which is basis of jqGrid will be recreated. So if you saved the <code>$("#jqGridElement")</code> in a variable (<code>var gridObj = $("#jqGridElement")</code> for example) you should refresh the value (with the assignment <code>gridObj = $("#jqGridElement")</code>).</p> <p>Now about your main question. The method <code>GridUnload</code> is useful in the case if you need add new column to the grid or create on the place of old grid <em>absolutely another</em> grid. (see <a href="https://stackoverflow.com/questions/4232038/jqgrid-add-new-column/4232168#4232168">the answer</a> or <a href="https://stackoverflow.com/questions/4232430/jqgrid-reload-grid/4233000#4233000">this one</a> as an example). If you need to add one row of data to the existing grid you can use <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#array_data" rel="nofollow noreferrer">addRowData</a> for example.</p> <p>What can be really important to you to understand is the usage of ids for every row (<code>&lt;tr&gt;</code> element). If you don't want to manage ids yourself you can use <code>undefined</code> as the <code>rowid</code> in the <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#array_data" rel="nofollow noreferrer">addRowData</a> method. In the case the <code>$.jgrid.randId()</code> method will be used internally to generate unique id for the new row.</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.
 

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