跳到主要内容

onBeforeRedo

Description

在调用 redo() 方法之前触发

onBeforeRedo: (action: any[]) => boolean;

Parameters

  • action - (required) array - 作为命令对象数组的用户操作

Returns

  • result - (boolean) - 定义事件的默认操作是否会被触发(true)还是被取消(false)

Example

gantt.attachEvent("onBeforeRedo",function(action){
// 在这里插入您的自定义逻辑
return true;
});

Details

注释

此事件在 undo 扩展中定义,因此您需要启用 undo 插件。请在 Undo/Redo Functionality 文章中阅读详细信息。

此事件是可阻塞的。返回 false 将取消后续处理。

action 参数表示一个命令对象的数组,每个对象包含以下属性集:

  • type - (string) 命令的类型:"add/remove/update"
  • entity - (string) 被修改对象的类型: "task" 或 "link"
  • value - (object) 更改后的任务/链接对象
  • oldValue - (object) 修改前的任务/链接对象

Change log

  • 新增于版本 4.0
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.