I have local data delete functionality:
$.each(rowids, function() { // – delete selected rows
$grid.delRowData(this);
});
I noticed that after this call, doing retrieving the _index:
var xref = $grid.jqGrid(‘getGridParam’, ‘_index’);
the _index still contains the deleted row.
I looked into the JQGrid source, after the deletion of the local data, a call to refreshIndex() is made. I noticed that the Index is not removed, but rather the existing array is overwritten:
for (i = 0; i < datalen; i++) {
val = $.jgrid.getAccessor(ts.p.data, idname);
if (val === undefined) { val = String(i + 1); }
ts.p._index[val] = i;
}
I added the following right before the loop above:
ts.p._index = [];
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top