抱歉,是我没有讲清楚,您可以使用paint方法,但是要同时保证对单元格设置了formatter
我这里也绘制了一个蓝色横线,但是仍然可以正确搜索到:
- customCell.prototype.paint = function (ctx, value, x, y, w, h, style, context) {
- console.log("paint", arguments)
- ctx.strokeStyle = "blue"
- ctx.moveTo(x + w, y + h / 2)
- ctx.lineTo(x + w / 2, y + h / 2)
- ctx.stroke()
- GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments)
- }
复制代码
至于formatterBase的构造函数,其实按照我之前附上的代码写就好,如果ts中有报错,忽略一下就好了。
|