.hasChanges() results in records flagged for Delete to not actually get deleted when .saveChanges() executes.
I found the same behaviour on a LiveDemo example that checks .hasChanges(): Grid - Binding to Telerik ClientDataSource
Steps to reproduce:
Thank you for taking the time to report this problem. This is indeed an unexpected behavior of the Grid and we have recorded it in our system as a bug.
Workaround:
Instead of calling the built-in method "hasChanges()", try implementing a custom function to check for the changes like the example below:
function hasChanges(grid) {
return grid.get_batchEditingManager()._extractChangesString(grid.get_masterTableView()).length > 0;
}
When the Grid would call the UserAction, use the custom method like this:
function UserAction(sender, args) {
if (hasChanges(sender) && !confirm("Any changes will be cleared. Are you sure you want to perform this action?")) {
args.set_cancel(true);
}
}