onBeforeLightbox

在 lightbox(编辑表单)打开之前触发

boolean onBeforeLightbox(string|number id);
idstring|number任务的 ID
boolean决定是否继续执行默认事件动作(true)或阻止执行(false

Example

gantt.attachEvent("onBeforeLightbox", function(id) {
    const task = gantt.getTask(id);
    task.my_template = `<span id='title1'>Holders: </span>${task.users}
    <span id='title2'>Progress: </span>${task.progress*100}%`;
    return true;
});

Related samples

Details
  • 该事件可以被阻止。返回 false 将阻止 lightbox 打开。
  • 这是在 lightbox 显示之前进行自定义调整的便捷方式。
Back to top