I have a grid that displays steps in a process. The users are allowed to move rows up or down, reordering the steps. If that happens a jquery method is called that updated the sequence numbers on each row. The sequence numbers are stored with the data in the database so at the end of this process, the sync() method is called. All works as expected except that as the Update method is called for each of the rows that was updated, the Destroy method will be called for one of the rows and the row is deleted from the database:
function
resequence(grid) {
for
(
var
i = 0; i < grid.dataSource.data().length; i++) {
grid.dataSource.data()[i].ActionSequenceNum = i + 1;
grid.dataSource.data()[i].dirty =
true
;
}
grid.dataSource.sync();
}
I can't seem to figure out why one row is also triggering the Destroy method.