math in treatable widget

Hi,
I have a strange behaviour in a code that I developed some days ago.
https://snippet.webix.com/z2cngffe

I have some columns values that are configured as formulas (I load data in JSON format from a php backend).
When I load data the formula are applied (I get the right results) but if I modify a column value the columns that are depending from this are not updated:
for example: { id:“fc_landed_cost”, editor:“text”,header:“Landed Cost”,
math:"[$r,extra_cost]+[$r,duty]+[$r,fc_cost_usd]"
if you try to edit extra_cost or duty, for example, the fc_landed_cost do not change.
If I modify the column margin, the list_price is updated.
Other columns have the formula in the data (I have different formulas depending on the “nature” of the product)
What is wrong in my code ?
Thanks
Massimo

Hi @maxdod ,

Your calculations are valid, so I can confirm the bug in math processing.

We will do our best to fix it until the next release, but so far the only option is to reorder your columns with math into a strict order of calculations: https://snippet.webix.com/ax1yysho

The current misbehaviour is the following:

  • All works well if the columns are ordered in the sequence of calculations, e.g.
cell1 = 2
cell2 = cell1 + 1
cell3 = cell2 + 1

In such case, the initial formulas are preserved in cells and available for further usage and changes (if editMath is enabled).

  • But if the order of columns does not correspond to the sequence of calculations:
cell1 = 2
cell3 = cell2 + 1
cell2 = cell1 + 1

The initially calculated data will be displayed, but the math formulas in columns and data won’t be preserved.

thanks !!