.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:
Hello Ken,
Yes, we will fix this issue when the time arrives. Currently we are dedicated to improving the performance and security of the Telerik Controls which comes with the highest priority.
Until the issue is resolved, please use the provided workaround.
Thank you for your understanding.
Regards,
Attila Antal
Progress Telerik
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);
}
}