简体   繁体   English

在Kendo Scheduler中处理销毁事件

[英]Handle destroy event in kendo scheduler

I am using a kendo scheduler. 我正在使用剑道调度程序。 There are events added in scheduler grid. 在调度程序网格中添加了事件。

On mouse hover of each event a small (x) comes on top right corner. 将鼠标悬停在每个事件上时,右上角会出现一个小(x)。 ie destroy event for that event, which when clicked shows an warning message "Are you sure you want to delete this event?" 即销毁该事件的事件,单击该事件将显示警告消息“确定要删除此事件吗?” If clicked Yes it goes ahead and deletes that event. 如果单击“是”,它将继续并删除该事件。

So here is my requirement. 所以这是我的要求。

在此处输入图片说明

As you can see above there are 3 scheduled events in the shown week. 如您在上方看到的,在所示的星期中有3个预定的事件。 I want that, the one circled in blue shouldn't have delete option but the one circled in red should have. 我想要那个,蓝色圈出的那个不应该有删除选项,但是红色圈出的那个应该有。 In other words, I want to restrict some events in the kendo scheduler from deleting. 换句话说,我想限制kendo Scheduler中的某些事件不被删除。

Scenario: Lets say any event having a description can't be deleted. 场景:可以说任何具有描述的事件都不能删除。

Link: http://demos.telerik.com/kendo-ui/scheduler/move-resize 链接: http//demos.telerik.com/kendo-ui/scheduler/move-resize

Update I can do a server side call to check if description has value or not and then return any result to show any message that I want, but I want restriction at client side only so that an user won't be able to click that (x) link and it is not displayed at all. 更新我可以进行服务器端调用,以检查描述是否有价值,然后返回任何结果以显示我想要的任何消息,但是我只想在客户端进行限制,以使用户无法单击该命令( x)链接,它根本不显示。

There are several ways to handle this scenario. 有几种方法可以处理这种情况。 For example you can attach custom "click" event handler to the "X" button in the event element in which to either allow or restrict propagation of the event. 例如,您可以将自定义“ click”事件处理程序附加到事件元素中的“ X”按钮,以允许或限制事件的传播。 If you need the underlying event object you can get it by passing the "uid" attribute of the event element to the "occurrenceByUid" method of the scheduler. 如果需要基础事件对象,则可以通过将事件元素的“ uid”属性传递给调度程序的“ occurrenceByUid”方法来获取。

Example

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM