You do not include the code createGrid, so I can only guess. One possible reason is that you are using inside a variable grid. If you use GridUnload, the old item <table>will be deleted and the other will be created in the same place. Thus, you should reset the value gridafter the call GridUnload:
var gridId = grid[0].id;
grid.jqGrid('GridUnload');
grid = $('#' + $.jgrid.jqID(gridId));
createGrid();
The method $.jgrid.jqIDyou should use only if the idgrid can contain a meta character .
source
share