Hello!
In our application, BatchUpdate is enabled, and a user can add and edit rows as he wish. If he now leaves the current sub-page containing the grid, we check if such changes exist via JavaScript (by using grid.get_behaviors().get_editingCore().get_addedRows() for instance).
The problem now is: If the user didn't save, a dialog pops up asking whether he wants to discard the changes or go back. If he chooses to discard the changes, I wonder how I can manage this, preferably in JavaScript, since a postback will immediately triggersavingthe data instead, which I don't want to happen. Is there a way to reroll the grid to a point before the changes?
I tried emptying the get_addedRows() and get_editedRows() array, but that doesn't work at all as I wish. Deleting the addedRows manually via grid.get_rows().remove(addedRows[index]) doesn't work either, because then the row isn't actually deleted because of the BatchUpdating, but just marked for deletion (although RowDeleting isn't even enabled^^, so a postback after this wouldn't even know how to handle that case).
Do you have any ideas/suggestions what I could do to get this behavior? Last resort I could think of would be to store some JavaScript value in a hidden field, which I would then access on postback and tell the OnRowAdding/OnRowUpdating handlers "don't do anything!".
Thanks!
Hi Johannes Maier,
Thank you for posting on our forums.
I am happy that you were able to find the solution using the clearBatchUpdate() method. Here are a list of all the available members for the EditingCore class:http://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=WebDataGrid~Infragistics.Web.UI.EditingCore~clearBatchUpdates.html
Please let me know if you have further questions regarding this method.
Nevermind, I have just discovered get_editingCore().clearBatchUpdate() or similar :-)