找回密码
 立即注册

QQ登录

只需一步,快速开始

AlexZ 讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-3-2 15:37  /   查看:2744  /  回复:0
本帖最后由 AlexZ 于 2021-3-2 15:39 编辑

区域快照顾名思义,会将表格中的某一个单元格区域,作为类似『图片』的形式在某一时刻进行『拍照』,『照片』作为形状浮动在表格上,作为原始记录的参考,效果如下图: camera-tool-real-change.gif

示例代码:
  1. var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {
  2.         sheetCount: 2
  3. });
  4. var sheet = spread.getSheet(0);
  5. var range = sheet.shapes.addCameraShape('cameraShape', 'A1:D7', 600, 100);
复制代码


API:
  1. ///* function addCameraShape(name: string, range: string, left: number, top: number, width?: number, height?: number): GC.Spread.Sheets.Shapes.CameraShape
  2. /**
  3. * Add a new camera shape to shape collection
  4. * @param {string} name The name of the camera shape. If leave blank an unique name will be generated.
  5. * @param {string} range The range of the shape generated from, it should be a range formula, like Sheet1!A1:A8.
  6. * @param {number} left The <i>x</i> location of the camera shape.
  7. * @param {number} top The <i>y</i> location of the camera shape.
  8. * @param {number} [width] The width of the camera shape, if leave blank the default value should be same as the original range width.
  9. * @param {number} [height] The height of the camera shape, if leave blank the default value should be same as the original range height.
  10. * @return {GC.Spread.Sheets.Shapes.CameraShape} The shape that has been added to the sheet.
  11. * @example
  12. * var shape = activeSheet.shapes.addCameraShape("camera shape 1", 'Sheet1!A1:A8', 100, 50, 100, 150);
  13. */
  14. addCameraShape (name: string, range: string, left: number, top: number, width?: number, height?: number): ShapeBase
复制代码





0 个回复

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