onBeforeUndo
Description
在 undo() 方法执行之前触发
onBeforeUndo: (action: any[]) => boolean;
Parameters
action- (required) array - 包含命令对象的数组
Returns
result- (boolean) - 决定事件的默认操作是否继续执行(true)或被阻止(false)
Example
gantt.attachEvent("onBeforeUndo", function(action){
// 在这里编写你的代码
return true;
});
Related samples
Details
该事件可以被阻止。返回 false 将停止后续的任何处理。
action 参数是一个命令对象数组,每个对象包含以下属性:
- type - (string) 命令类型:"add"、"remove" 或 "update"
- entity - (string) 被更改对象的类型:"task" 或 "link"
- value - (object) 变更后的任务或链接对象
- oldValue - (object) 变更前的任务或链接对象
Related API
Related Guides
Change log
- 版本 4.0 中新增