onBeforeTaskAutoSchedule
信息
该功能仅在 PRO 版本中可用。
Description
对于每个被重新排程的任务触发
onBeforeTaskAutoSchedule: (task: Task, start: Date, link: Link, predecessor: Task) => boolean;
Parameters
task- (required) Task - 任务对象start- (required) Date - 一个新的开始日期link- (required) Link - 创建约束的链接对象predecessor- (required) Task - 前置任务对象
Returns
result- (boolean) - 定义事件的默认操作是否会触发 (true) 还是取消 (false)
Example
gantt.attachEvent("onBeforeTaskAutoSchedule",function(task, start, link, predecessor){
// 在这里插入您的自定义逻辑
return true;
});
Related samples
Details
注释
此事件在 auto_scheduling 扩展中定义,因此你需要激活 auto_scheduling 插件。请在 Auto Scheduling 文章中了解详细信息。
该事件是可阻塞的。返回 false 将取消后续处 理。
Related API
- auto_scheduling
- auto_scheduling_descendant_links
- auto_scheduling_initial
- auto_scheduling_move_projects
- auto_scheduling_project_constraint
- auto_scheduling_strict
- auto_scheduling_use_progress
- findCycles
- isCircularLink
- onAfterAutoSchedule
- onAfterTaskAutoSchedule
- onBeforeAutoSchedule
- onCircularLinkError
- onAutoScheduleCircularLink
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.