kendo ui 事件是 Javascript 事件吗?
或者它们完全是不同的类型?
我问这个问题的原因是因为我尝试实现以下 Stack Overflow 问题的答案:
Javascript: cancel or let an event continue?
但是我们所期望的 Javascript 事件功能并不存在。
最佳答案
Kendo UI 事件不是 DOM 事件,因此您在其他问题上得到的答案可能不是正确的方法。 Kendo UI 只是将事件处理程序数组存储在一个数组中(每个事件名称),然后像这样调用它们:
// events is the array of event handlers for a given event, e.g. the "edit" event
// e is whatever the caller passes in to the trigger method,
// "that" is the observable (typically a Kendo UI widget, e.g. your scheduler)
for (idx = 0, length = events.length; idx < length; idx++) {
events[idx].call(that, e);
}
事件的触发如下:
// the first param is the event name,
// second the event object passed to the handler
// scheduler is an observable, e.g. a Kendo UI Scheduler widget instance
scheduler.trigger("edit", { sender: this });
可以看看Kendo UI中事件的实现here (在 Observable
类中查找 trigger
方法)。
关于javascript - kendo ui 事件(或来自其他框架的事件)是 Javascript 事件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23686233/