跳到主要内容

onBeforeTaskDelete

Description​

在用户删除任务之前触发

onBeforeTaskDelete: (id: string | number, task: Task) => boolean;

Parameters​

  • id - (必填) string | number - 任务 id
  • task - (必填) Task - 任务对象

Returns​

  • result - (boolean) - 定义事件的默认行为是否会被触发(true)还是被取消(false)

Example​

gantt.attachEvent("onBeforeTaskDelete", function(id,task){
//在此处执行任意自定义逻辑
return true;
});

Details​

该事件是可阻塞的。返回 false 以取消删除该任务。

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.