跳到主要内容

getUndoStack

Description

返回存储的撤销用户操作栈

getUndoStack: () => UndoRedoAction[]

Returns

  • stack - (UndoRedoAction[]) - 一个包含撤销用户操作的数组

Example

var stack = gantt.getUndoStack();

Details

注释

note 此方法属于 undo 扩展,因此必须启用 undo 插件。更多详情请参见 撤销/重做功能 文章。

返回的栈是撤销用户操作的一个数组。每个用户操作包含一组命令。一个命令是具有以下属性的对象:

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

请看下面的示例: get_undo_stack

getUndoStack() 方法返回一个包含 2 个撤销用户操作的堆栈。第一个操作包含 3 个命令,第二个操作包含 1 个命令。

Change log

  • added in version 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.