Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is not possible to add a column to the jqGrid dynamically. You have to recreate the whole grid with <code>colModel</code> having one column more. If you use separate <code>colNames</code>, then the size of the array have to be increased too. You can use <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods#add_on_grid_methods" rel="noreferrer">GridDestroy</a> for example to destroy the existing grid. The usage of <code>jQuery.Remove</code> or <code>jQuery.Empty</code> instead is also possible.</p> <p><strong>UPDATED</strong>: It seems to me that <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods#add_on_grid_methods" rel="noreferrer">GridUnload</a> is better for your porpose. I created <a href="http://www.ok-soft-gmbh.com/jqGrid/RecreateGrid.htm" rel="noreferrer">small demo</a> which demonstrate how one can recreate a grid. To be able to use <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods#add_on_grid_methods" rel="noreferrer">GridUnload</a> or <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods#add_on_grid_methods" rel="noreferrer">GridDestroy</a> you have to verify that you include grid.custom.js in your project (if you use developer version of the jqGrid) or you have checked "Custom" "Additinal methods" on the <a href="http://www.trirand.com/blog/?page_id=6" rel="noreferrer">jqGrid download</a> page.</p> <p><strong>UPDATED 2</strong>: One can use <code>addColumn</code> method which can be downloaded from <a href="https://github.com/OlegKi/jqGrid-plugins" rel="noreferrer">here</a> (see <code>jQuery.jqGrid.addColumn.js</code>). The method is still in beta phase. One can find some demos which shows how to use the method <a href="https://github.com/OlegKi/jqGrid-plugins/tree/master/demos" rel="noreferrer">here</a> (see <code>addColumnX.htm</code> examples).</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