onBeforeRedo
Description
在 redo() 方法执行之前触发
onBeforeRedo: (action: any[]) => boolean;
Parameters
action- (required) array - 表示用户操作的数组,由命令对象组成
Returns
result- (boolean) - 决定事件的默认行为是否继续执行(true)或被阻止(false)
Example
gantt.attachEvent("onBeforeRedo",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 新增