跳到主要内容

locate

Description

从指定的 HTML 事件中获取任务的 ID

locate: (e: Event) => string | number

Parameters

  • e - (必填) Event - 原生事件

Returns

  • id - (string | number) - 任务 ID

Example

gantt.$container.addEventListener("mouseover", function(event){
const taskId = gantt.locate(event);
if(gantt.isTaskExists(taskId)){
gantt.message({
id:1,
text:"Mouse over " + gantt.getTask(taskId).text});
}
});
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.