找回密码
 立即注册

QQ登录

只需一步,快速开始

fyll

注册会员

2

主题

2

帖子

10

积分

注册会员

积分
10
最新发帖
fyll
注册会员   /  发表于:2016-12-12 10:01  /   查看:3177  /  回复:1
export class CheckBoxCellType extends GcSpread.Sheets.CheckBoxCellType {

    constructor() {
        super();
    }

    paint(ctx, value, x, y, width, height, style, context) {
        var basePaint = GcSpread.Sheets.CheckBoxCellType.prototype.paint;
        //style.backColor="red";
        style.foreColor="red";
        style.borderLeft = new GcSpread.Sheets.LineBorder("red", GcSpread.Sheets.LineStyle.thin);
        style.borderTop =new GcSpread.Sheets.LineBorder("red", GcSpread.Sheets.LineStyle.thin);
        style.borderRight =new GcSpread.Sheets.LineBorder("red", GcSpread.Sheets.LineStyle.thin);
        style.borderBottom =new GcSpread.Sheets.LineBorder("red", GcSpread.Sheets.LineStyle.thin);
        var checked = Boolean(context.sheet.getDataItem(context.row).checked);
        basePaint.apply(this, [ctx, checked, x, y, width, height, style, context]);
    }}
设置checkbox的边框,没作用,如何设置?效果如下:
1.png

1 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-12-12 17:31:33
沙发
您是想修改整个单元格的边框还是 checkbox 方框的颜色?

如果是整个单元格的边框,不需要paint方法中实现,直接给cell设置style即可。

如果是要改checkbox的颜色,那么需要重新用canvas绘制 方框,以及勾选状态。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部