getUndoStack
Description
返回存储的撤销用户操作栈
getUndoStack: () => UndoRedoAction[]
Returns
stack- (UndoRedoAction[]) - 一个包含撤销用户操作的数组
Example
var stack = gantt.getUndoStack();
Related samples
Details
返回的栈是撤销用户操作的一个数组。每个用户操作包含一组命令。一个命令是具有以下属性的对象:
- type - (string) 命令的类型:"add/remove/update"
- entity - (string) 被更改对象的类型: "task" 或 "link"
- value - (object) 已更改的 task/link 对象
- oldValue - (object) 更改前的 task/link 对象
请看下面的示例:

getUndoStack() 方法返回一个包含 2 个撤销用户操作的堆栈。第一个操作包含 3 个命令,第二个操作包含 1 个命令。
Related API
Related Guides
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.