onBeforeTaskDisplay
Description
在任务已加载到甘特图后,但在显示之前触发
onBeforeTaskDisplay: (id: string | number, task: Task) => boolean;
Parameters
id- (必填) 字符串 | 数字 - 任务 IDtask- (必填) Task - 任务对象
Returns
result- (布尔值) - 定义事件的默认操作是否会被触发(true)还是取消(false)
Example
gantt.attachEvent("onBeforeTaskDisplay", function(id, task){
if (task.priority == "high"){
return true;
}
return false;
});
Details
该事件是可阻塞的。返回 false 将阻止任务被显示
Related API
Related Guides
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.