Hi there
We set the colTypes with the following:
mygrid.setColTypes(‘co,dhxCalendarA,edn,ro,ed,ed,ed,edn,edn,ron[=c8-c7]’);
And add new rows like this:
var newUID = this.getUID();
mygrid.addRow(newUID,’’,-1);
mygrid.cells(newUID,0).setValue(mygrid.cellById(this.getRowId(this.getRowsNum()-2),0).getValue());
mygrid.cells(newUID,1).setValue(thisDay());
mygrid.selectCell(newUID,0);
But rows added after the page has loaded the first time, don’t recalculate if edited. If we add a new row it calculates correctly, but when we edit the line afterwards, it doesn’t recalculate the result - how come?
Incorrect ID is most possible reason of the problem.
Please be sure that this.getUID(); returns really unique IDs ( it it based on timestamp - it may return not unique values, because js Date object is not so precise )
I’ve tried inserting a couple of lines and logging the ID’s, and got the following:
1235549619762
1235549619763
1235549619764
1235549619765
1235549619766
So they are pretty much unique.
It seems the problem with recalculating the result only appears after the row has been written to the database. If the row hasn’t been written, it recalculates fine.
Problem confirmed.
After inserting row in DB, ID of record changed to one provided by DB, in same time math operations still relay on old ID
Updated version of dhtmlxgrid, where issue fixed, will be sent by email.
Thank you very much.
Hello again
I’ve recieved the file now, but it didn’t solve the problem. It still doesn’t recalculate the result.
And also, in line 1948 there is a call to debugger, which makes FireBug for FireFox act up.
And also, in line 1948 there is a call to debugger, which makes FireBug for FireFox act up.
Sorry for inconvenience, correct js file resent.
>>but it didn’t solve the problem
Which version of dhtmlxgrid you are using?. Fix must work for dhtmlxgrid 1.6+
The readme file states: dhtmlxGrid v.2.0 Professional edition build 81009/81107
Updated dhtmlxgrid_math.js sent by email as well, please try to update it in addition to updated dhtmlxgrid.js
Thank you guys. That helped.
Just thought I would let you know that it seems like the footer has the same problem.
Do you mean stat-counters in footer? Stat counters functionality not related to rows, so it must not be affected by changes of IDs or similar issues.
If data in counter not updated after such operation - you may try to add next call
grid.callEvent(“onGridReconstructed”,[]);