@(Html.Kendo().Scheduler<ViewModel>()
.Name("scheduler")
.Date(DateTime.Today)
.Events(events => events
.Edit("ShowBookingPopup")
.Save("ShowBookingPopup")
......
)
* ShowBookingPopup - 是自定义Java脚本函数,通过该函数您可以有条件允许或阻止如下所示的编辑。
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();
}
}
您还可以使用其他事件在Telerik的事件的例子进行了说明,并自定义您的调度程序的行为。 http://demos.telerik.com/kendo-ui/web/scheduler/move-resize.html
@LarsHöppner:我做了链接http://demos.telerik.com/kendo-ui/web/scheduler/index.html上给出的示例。开始时可以,但我没有发现或可能未能注意到任何此类事件/代码,以防止编辑或修改已完成的事件。 – Praveen