找回密码
 立即注册

QQ登录

只需一步,快速开始

AlexZ 讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-3-2 16:17  /   查看:2878  /  回复:0
SpreadJS 通过命令管理器提供了 Undo/Redo 功能,但有些用户想一次 Undo 多个步骤,或者 Undo 到指定的操作步骤,基于此, 新版本中讲通过几个 API 接口返回当前操作的 Undo/Redo 栈(数组),便于用户根据实际需求,自行控制,如下图: image.png858424682.png


API:getRedoStack
  1. ///* function getRedoStack()
  2. /**
  3. * Get the redo stack.
  4. * @returns {Command[]} ICommand is an object. It include sheetName and cmd. the type of sheetName and cmd both is string.
  5. */
复制代码


API:getUndoStack
  1. ///* function getUndoStack()
  2. /**
  3. * Get the undo stack.
  4. * @returns {Command[]} ICommand is an object. It include sheetName and cmd. the type of sheetName and cmd both is string.
  5. */
复制代码


API:maxSize
  1. ///* function maxSize(value?: number):any
  2. /**
  3. * Gets or sets the the undo/redo stack max size.
  4. * @param {number} value this value should be greater or equal to 0.
  5. * @returns {number | UndoManager} If no value is set. return the max size of undo/redo stack. otherwise return UndoManager.
  6. */
复制代码




0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部