Formula not working onLoad

Tags: #<Tag:0x00007efc7095fdf8>

I pull the data from backend and loadData on to the table. Then I setDataAtCell (3, 7, '=SUM(H7:H199)') to calcuate the sum of the column. When the page loads, the formula doesn’t sum up the values in the column and just shows 0.
formula_01

But the formula starts to sum once I double click the cells and hit enter.
formula_02

Looks like the hyperformula engine only registers the numbers in the cell once I click and return.

Hi @ashishs

I’ve prepared similar, simplified example of your issue and the solution with loadData() works just fine: https://jsfiddle.net/aszymanski/bspz8koj/

If you could send your code demo it would be great.

Hi Adrian,
I am binding data to array of objects and am using data model to define the type. The problem is I am actually using the first few rows as headers. So I’m basically using array spread operator to combine the header rows with data and loadData into the table. I’ve isolated the issue somewhere there.

My question is, is there a way to skip first few rows when I loadData ?

P.S. - The formula works perfectly if I use array of array and not do data binding using array of objects, i.e. column options with data = properties. This is not a clean solution as opposed to using data model and object-property binding though.

Hi @ashishs

Sorry for late response. Answering your question. I think that you might use spliceRow method to make it work. Here’s an example of how it can be used: https://jsfiddle.net/aszymanski/pnxqdj75/

Hi @adrian.szymanski,

Thanks for the reply. spliceRow doesn’t work on objects. Also, it took me hours before I realized Hyperformula doesn’t support objects. You should have mentioned that in known limitations.