I'm using kendo scheduler and I want to use server validation. When server returns validation error (via ModelState - ToDataSourceResult extension) then I want to show them in popup. Now I have problem how to prevent editor window to be closed?
I have following code (it works for grid popup editor and server validation errors):
onError: function (args) {
if (args.errors) {
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.one("dataBinding", function (e) {
e.preventDefault(); // cancel grid rebind if error occurs - this prevents window to closing
/* some error handling */
});
} else {
alertify.error("Unknown error occurred");
}
}
I found following code which looks like a bug. This is "refresh" method od scheduler. I think that it should check result of trigger("dataBinding") and call _destroyEditable when event wasn't prevented:
this.trigger("dataBinding");
if (!(e && e.action === "resize" && this.editable)) {
this._destroyEditable();
}
EDIT:
Here's code from grid:
if (that.trigger("dataBinding", { action: e.action || "rebind", index: e.index, items: e.items })) {
return;
}
I post the same question on telerik forum and fix will be added to next internal build.