eventRemove
Description
从 HTML 元素移除一个事件处理程序
eventRemove: (node: HTMLElement | string, event: string, handler: GanttCallback, options?: boolean | HandlerSettings) => void
Parameters
node- (必填) HTMLElement | string - HTML 节点或其 IDevent- (必填) string - HTML 事件名称(不带 'on' 前缀)handler- (必填) function - 事件处理程序options- (可选) boolean | HandlerSettings - 可选,表示 useCapture 参数或 options 参数的值。请参阅详细信息
Example
const handler = function(event){
console.log("event!");
};
var element = document.querySelector(".my-element");
gantt.event(element, "click", handler);
gantt.eventRemove(element, "click", handler);
Details
通过 event 绑定的事件监听器将在调用 destructor 时自动分离。
Related API
Related Guides
Change log
- 在版本 4.0 中新增
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.