找回密码
 立即注册

QQ登录

只需一步,快速开始

Lynn.Dou 讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-5-7 15:18  /   查看:1937  /  回复:0
SpreadJS V14 Update1 中对按钮单元格做了增强,新增了自定义悬停背景色的功能。
使用方式也较为简单,增加了hoverBackColor属性,设置目标背景色即可。
具体可以参考下方示例代码:

  1. let style = new GC.Spread.Sheets.Style();
  2.    style.cellButtons= [{
  3.          imageType: GC.Spread.Sheets.ButtonImageType.dropdown,
  4.          hoverBackColor: "#3390FF", // customize the hover backColor
  5.          buttonBackColor: "#82BC00", // customize the button backColor
  6.          command: "openColorPicker",
  7.       },
  8.       {
  9.          imageType: GC.Spread.Sheets.ButtonImageType.dropdown,
  10.          command: (sheet, row, col, option) => {
  11.                //do something
  12.          },
  13.       }
  14.    ];
  15.    sheet.setStyle(0, 0, style);
  16.    sheet.setValue(0, 0, "Text");
复制代码

下方为示例动图,可以直观的看到该功能产生的效果。


demo1.gif

0 个回复

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