Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Atanas Koev on Oct 27, 2008 03:45
open dhtmlx forum
DHtmlXGrid math cells formula is overwritten

Hello,

I’m using DHtmlXGrid v.2.0 build 81009 with math cells. I notice that when changing a value of a linked cell (cell that participates in the formula of a math cell) the original formula (normally stored in cell.original) is lost. This is because in the onCellChanged event for the linked cell the following code is executed:

this.cells5(cell[i]).setValue(this._calcSCL(cell[i]));
for every every linked math cell

Since in the setValue function for the math cell we have:

cell.orginal = val // where val is now the calculated by _calcSCL value

This overwrites the formula of the math cell and it is no longer available. (I need it mainly during serialization)
I fixed this by changing the line:

this.cells5(cell[i]).setValue(this._calcSCL(cell[i]));

with:

this.cells5(cell[i]).setLabel(this._calcSCL(cell[i])); // which only changes the label of the math cell

Is this the right thing to do in this situation? Or the overwriting of the formula is done by design. Should I make any other changes?

Thanks in advance,

Atanas Koev
Answer posted by Support on Oct 27, 2008 07:10
Problem confirmed and fixed, fixed js file sent by email. 
The modification which you have proposed - will fix issue as well, but it may have some size-effect in case of complex math manipulation.