Skip to content Skip to sidebar Skip to footer

Jqgrid Reload Grid

It's an addition for previous my question about adding columns into jqGrid-based table. Here my new js-code: var col_names = ['First', 'Second', 'Third', 'Fourth', 'Fifth']; var co

Solution 1:

You can do about following

var counter=1; // to be able to click more then one time
$("#add_column").click(function() {
    $("#list").jqGrid('GridUnload');

    col_names.push('New'+counter);
    col_model.push({name: 'test'+counter, index: 'test'+counter, width: 100});
    counter++;

    createGrid();
});

Solution 2:

try not to Destroy/Create, but .trigger("reloadGrid");

UPD:: try to pass loadonce:false to grid creation params

UPD2:: Seemed like jQgrid cant operate with column changes "On fly". Try to destroy first grid and create another one instead of it.

Post a Comment for "Jqgrid Reload Grid"