本帖最后由 HHJ1983 于 2017-11-18 13:36 编辑
Spread sheet 自定义单元格类型出错,麻烦懂的人指点一下是什么情况,谢谢
代码如下:
- //define BindingPathCellType
- function BindingPathCellType():void{
- GC.Spread.Sheets.CellTypes.Text.call(this);
- }
- BindingPathCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
- BindingPathCellType.prototype.paint = function(ctx:CanvasRenderingContext2D, value:string, x:number, y:number, w:number, h:number, style : any, context : any){
- if (value === null || value === undefined) {
- var sheet = context.sheet, row = context.row, col = context.col;
- if (sheet && (row === 0 || !!row) && (col === 0 || !!col)) {
- var bindingPath = sheet.getBindingPath(context.row, context.col);
- if (bindingPath) {
- value = "[" + bindingPath + "]";
- }
- }
- }
- GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
- };
-
- var bindingPathCellType = new BindingPathCellType();
复制代码
代码是typescript,不是javascript,红色部分提示错误:
[ts] 其目标缺少构造签名的 "new" 表达式隐式具有 "any" 类型。
(local function) BindingPathCellType(): void
如下图:
|
|