Please help with following problem:
On the client I add new row, after that I want to remove this row.
Scenario is following:
1. User clicks some button, new row is added.
2. Later user clicks Cancel button, I want to remove previosly added row.
I don't need any postbacks or other actions.
I do following:
myAddedRow.get_grid().get_rows().remove(myAddedRow);
But this doesn't remove row, just marks it as deleted, the button "Undo" is shown in the grid.
How can I completely remove this row?
Please help, using UltraWebGrid it was a default behavior.
Alexander
Hi, David!
Thank you for your answer.
Yes, batch updating is on. Yes, row has been added on client, and I want to remove it on the client side
I've tried following:
addedRow.get_grid().get_behaviors().get_editingCore().undoBatchUpdate(addedRow);
This method removes it from the list, but after that I cannot select the last row in the grid.
If I click on any rows, I get java script errors.
And If I try again to add row and call this method it doesn't remove it.
Should I call remove method for the added row before this method or after
addedRow.get_grid().get_rows().remove(addedRow);
Actually I've tried but no success.
By the way, David, could you also have a look at this problem, maybe you can have some ideas
http://community.infragistics.com/forums/p/65438/331336.aspx#331336
Thank you,
Hi Alexander,
It sounds like you have batch updating on. If you have added a row on the client and not yet had it commited and then want it completely removed, you should call editingCore.undoBatchUpdate(row); This will completely remove it. If the row was already there, it will just mark it for deletion. You could set the DeletedRow role to have display none or something. That may work.
regards,David Young