Handsontable Save formula values

前端 未结 1 868
闹比i
闹比i 2021-01-24 17:08

I want integrate handsontable to my site, but a got a problem, when im trying to save data created by RuleJS (formula support), script give me a formula back like (=$A1*

相关标签:
1条回答
  • 2021-01-24 17:41

    An object is a property Handsontable plugin.matrix.data - a list of cells, which are calculated according to the formulas in the table. Each cell has a property value - this is the displayed result. To get all of the data will have to use the function: Handsontable.plugin.helper.cellValue or Handsontable.plugin.helper.cellRangeValue.

    For example for your jsfiddle:

    to get from the top-right of the cell:

    data = hot.plugin.helper.cellValue ('C1');
    console.log (data);
    

    48168.89000000001 obtaining values ​​of all cells (a list):

    data = hot.plugin.helper.cellRangeValue ('A1', 'C2');
    console.log (data);
    

    Array [6]: 0: 625.57 1: 656.95 2: 77 3: 77 4: 48168.89000000001 5: 50585.15 length: 6

    I think that is a better method than cellRangeValue not. But on this basis we can write something more comfortable. See. Handsontable.plugin.helper.cellRangeValue

    0 讨论(0)
提交回复
热议问题