你需要先将坐标0,0转为A1的形式,例如
- var a =0;
- var b =0;
- var range = new GC.Spread.Sheets.Range(a, b, 1,1)
- var value = GC.Spread.Sheets.CalcEngine.rangeToFormula(range, 0, 0, GC.Spread.Sheets.CalcEngine.RangeReferenceRelative.allRelative);
- console.log(value)
- spread.options.highlightInvalidData = true;
- var sheet = spread.getActiveSheet();
- let dv1 = GC.Spread.Sheets.DataValidation.createFormulaValidator(`=ISNUMBER(value)*AND(LEN(value)-FIND(".",value&".")<=2)`);
- dv1.ignoreBlank(false);
- sheet.setDataValidator(1, 1, dv1);
复制代码
|