Sorting issues
Hi! Me again.
I finish some functions to add, remove, update and "undo". Here is the delete one.
function deleteRow(dataGrid, myArray, index, lastActionPerformed){
if (confirm("You wanna delete me?")) {
delRow = myArray.splice(index,1);
dataGrid.setRowProperty("count", myArray.length);
dataGrid.refresh();
alert ("Deleted row: " + delRow );
return new lastAction("delete",index,delRow[0]);
} else {
return lastActionPerformed;
}
}
lastActionPerformed is a lastAction object (contains the info to undo), dataGrid is obj, myArray is myData and index is index :p
All work fine, but if i sort the grid the function stops working and the message " myData is null or isn't an object..." appears... :(
The index of row change when i sort?
Is needed a index (like in a database) to keep track of the rows and delete them searching in it?
I'm doing something wrong?
Please help.
Thanks.
I finish some functions to add, remove, update and "undo". Here is the delete one.
function deleteRow(dataGrid, myArray, index, lastActionPerformed){
if (confirm("You wanna delete me?")) {
delRow = myArray.splice(index,1);
dataGrid.setRowProperty("count", myArray.length);
dataGrid.refresh();
alert ("Deleted row: " + delRow );
return new lastAction("delete",index,delRow[0]);
} else {
return lastActionPerformed;
}
}
lastActionPerformed is a lastAction object (contains the info to undo), dataGrid is obj, myArray is myData and index is index :p
All work fine, but if i sort the grid the function stops working and the message " myData is null or isn't an object..." appears... :(
The index of row change when i sort?
Is needed a index (like in a database) to keep track of the rows and delete them searching in it?
I'm doing something wrong?
Please help.
Thanks.
Basking Rootwalla
May 11,