how to delete row from sorted grid
I am not sure what is the purpose of the deleteRow method. To delete a row from sorted grid I came up with the code:
var Row = TheGrid.getCurrentRow();
var SortIndex = TheGrid.getRowIndices();
if (SortIndex)
{
SortIndex.splice(TheGrid.getRowPosition(Row), 1);
var offset = TheGrid.getRowOffset();
for(var i = 0; i < SortIndex.length; ++i)
if (SortIndex[i] > Row + offset)
--SortIndex[i];
TheGrid.setRowIndices(SortIndex);
}
GridData.splice(Row, 1);
Is there a simpler method? Should not the deleteRow method handle it? I found that the following code will not work.
var Row = TheGrid.getCurrentRow();
TheGrid.deleteRow(Row);
GridData.splice(Row, 1);
var Row = TheGrid.getCurrentRow();
var SortIndex = TheGrid.getRowIndices();
if (SortIndex)
{
SortIndex.splice(TheGrid.getRowPosition(Row), 1);
var offset = TheGrid.getRowOffset();
for(var i = 0; i < SortIndex.length; ++i)
if (SortIndex[i] > Row + offset)
--SortIndex[i];
TheGrid.setRowIndices(SortIndex);
}
GridData.splice(Row, 1);
Is there a simpler method? Should not the deleteRow method handle it? I found that the following code will not work.
var Row = TheGrid.getCurrentRow();
TheGrid.deleteRow(Row);
GridData.splice(Row, 1);
Adam Zielinski
April 12,