跳到主要内容

onAfterTaskMove

Description

任务移动到新的垂直位置后触发

onAfterTaskMove: (id: string | number, parent: string | number, tindex: number) => void;

Parameters

  • id - (required) string | number - 要移动的任务的 ID
  • parent - (required) string | number - 父级 ID
  • tindex - (required) number - 将任务移动到的父分支中的位置索引

Example

// 防止移动到另一个子分支
gantt.attachEvent("onAfterTaskMove", function(id, parent, tindex){
// 在这里插入您的自定义逻辑
});

Details

注意,该事件在以下两种情况下触发:

  1. 当调用方法 moveTask
  2. 当默认模式启用选项 order_branch 且用户拖动任务时 (gantt.config.order_branch = true;)
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.