找回密码
 立即注册

QQ登录

只需一步,快速开始

crawler

高级会员

115

主题

417

帖子

1012

积分

高级会员

积分
1012
crawler
高级会员   /  发表于:2021-9-23 15:20  /   查看:1719  /  回复:3
怎么实现图片的功能, 或者其它方案也行 我需要做个按钮弹窗,弹窗显示单元格的内容 image.png612284240.png

3 个回复

倒序浏览
Lynn.Dou讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-9-23 15:51:07
沙发
您好,
可以使用 单元格按钮,关于此部分内容学习指南有详细介绍,您可以参考学习指南中的demo:
image.png739146117.png
示例代码:
  1. var sheet = spread.getSheet(0);
  2.     sheet.suspendPaint();
  3.     sheet.setColumnWidth(1, 100);

  4.     style = new GC.Spread.Sheets.Style();
  5.     style.cellButtons = [
  6.         {
  7.             useButtonStyle: true,
  8.             position: GC.Spread.Sheets.ButtonPosition.left,
  9.             width: 20,
  10.             command: (sheet, row, col, option) => {
  11.                 var value = sheet.getValue(row, col);
  12.                 alert(value);
  13.             }
  14.         }
  15.     ];
  16.     sheet.setText(0, 0, "command");
  17.     sheet.setStyle(0, 1, style);
  18.     sheet.resumePaint();
复制代码
完整代码见附件。

cellButton.zip

1.45 KB, 下载次数: 37

回复 使用道具 举报
crawler
高级会员   /  发表于:2021-9-23 16:03:55
板凳
demo地址发我一下可以吗
回复 使用道具 举报
Lynn.Dou讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-9-23 16:18:54
地板
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部