本帖最后由 WilliamChang 于 2021-12-20 12:23 编辑
我来提供一个变通方案,可以创建一个自定义方法,然后在evaluateFormula的时候包一下就可以了:
- function GetArrayFunction() {
- this.name = 'GETARRAY';
- this.maxArgs = 1;
- this.minArgs = 1;
- }
- GetArrayFunction.prototype = new GC.Spread.CalcEngine.Functions.Function();
- GetArrayFunction.prototype.evaluate = function (arg) {
- console.log(arg);
- }
-
- GetArrayFunction.prototype.acceptsArray = function(){ return true;};
- var f = new GetArrayFunction();
- spread.addCustomFunction(f);
- GC.Spread.Sheets.CalcEngine.evaluateFormula(sheet, "=GETARRAY(FILTER(A1:A7,A1:A7>3))", 11,11);
复制代码
|