onAfterTaskMove
Description
任务移动到新的垂直位置后触发
onAfterTaskMove: (id: string | number, parent: string | number, tindex: number) => void;
Parameters
id- (required) string | number - 要移动的任务的 IDparent- (required) string | number - 父级 IDtindex- (required) number - 将任务移动到的父分支中的位置索引
Example
// 防止移动到另一个子分支
gantt.attachEvent("onAfterTaskMove", function(id, parent, tindex){
// 在这里插入您的自定义逻辑
});
Details
注意,该事件在以下两种情况下触发:
- 当调用方法 moveTask 时
- 当默认模式启用选项 order_branch 且用户拖动任务时 (gantt.config.order_branch = true;)
Related API
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.