【问题标题】:Handson table and Rulejs autofill formulasHandsontable 和 Rules 自动填充公式
【发布时间】:2015-11-10 22:33:14
【问题描述】:

我想使用基于代码中 C1 和 C2 单元格的公式自动填充列(不是我手动双击或拖动)

【问题讨论】:

  • 你试过什么?你的代码现在是什么样子的?我的代码无法使用您的代码?

标签: javascript jquery excel-formula handsontable


【解决方案1】:

我试图利用自动填充(应用)插件,终于找到了如何使用它。这是为“C”列设置公式并将其应用于代码中前 10 行的代码

var hot = $('#TableContainer').handsontable('getInstance'); hot.setDataAtCell(1,2,"=sum(A2,b2)"); // 1,2 is C2 hot.selectCell(1,2, 1,2); // select C2 and apply this formula hot.autofill.instance.view.wt.selections.fill.add(new WalkontableCellCoords(1, 2)); hot.autofill.instance.view.wt.selections.fill.add(new WalkontableCellCoords(9, 2)); hot.autofill.apply(); // applies formula to the coords C2 to C10

【讨论】:

    猜你喜欢
    • 2016-01-21
    • 1970-01-01
    • 2015-03-12
    • 1970-01-01
    • 2017-11-28
    • 2021-09-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多