如何防止编辑已在剑道调度程序中完成的事件。
以下是两种情况:
假设该活动于 2014 年 1 月 5 日开始,并且持续(每天)10 天,即到 2014 年 1 月 15 日。所以现在不应该编辑它(现在=当前日期)
活动于 2014 年 2 月 5 日宣布,并将持续(每天)至 2 月 25 日。8 天后,即 2 月 13 日,编辑了整个事件系列。它应仅在 2 月 13 日至 2 月 25 日期间生效,并且不应完成一次。
任何帮助都将不胜感激。
如何防止编辑已在剑道调度程序中完成的事件。
以下是两种情况:
假设该活动于 2014 年 1 月 5 日开始,并且持续(每天)10 天,即到 2014 年 1 月 15 日。所以现在不应该编辑它(现在=当前日期)
活动于 2014 年 2 月 5 日宣布,并将持续(每天)至 2 月 25 日。8 天后,即 2 月 13 日,编辑了整个事件系列。它应仅在 2 月 13 日至 2 月 25 日期间生效,并且不应完成一次。
任何帮助都将不胜感激。
@(Html.Kendo().Scheduler<ViewModel>()
.Name("scheduler")
.Date(DateTime.Today)
.Events(events => events
.Edit("ShowBookingPopup")
.Save("ShowBookingPopup")
......
)
*ShowBookingPopup - is the custom java script function through which you can have a condition to allow or block the editing like below.
function ShowBookingPopup(e) {
var today = new Date();
// Your custom condition to allow/block editing of the event
if (e.event.Start < today) {
// If the event date is in the past then disallow update by blocking the default behavior and showing an alert for the same
setTimeout(function () {
alert("Cannot edit the event.");
}, 0);
e.preventDefault();
}
}
You can also use other events explained in the example of telerik events and customize to your behavior of the scheduler. http://demos.telerik.com/kendo-ui/web/scheduler/move-resize.html