Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by sasavi on Nov 06, 2007 19:31
open dhtmlx forum
Infinite Loop

Hello, after a thorough evaluation of numerous grid frameworks, we were most impressed with dhtmlX. We're most impressed with your arsenal of features and active and responsive support forum. We've just started developing the UI layer of our application using your professional edition, and ran into an infinite recursion(resulting in a stack overflow).

This issue is found on version: 1.4 (build 70813), professional edition of dhtmlxTreeGrid/dhtmlxDataProcessor.js.

I initialize the following data processor:

myDataProcessor = new dataProcessor("/url_to_send_updates_to");
myDataProcessor.setUpdateMode("off");
myDataProcessor.init(mygrid);

mygrid is a grid that renders perfectly and it accepts edits of cells correctly. After editing one or more cells and calling myDataProcessor.sendData(),
dhtmlxDataProcessor.js enters an infinite recursion between these two functions:

dataProcessor.prototype.sendData
and
dataProcessor.prototype.checkBeforeUpdate

At the end of dataProcessor.prototype.checkBeforeUpdate(), there is a condition that is always true and will always recurse:

if ((fl || !mandExists) && updateFl) {
this.sendData(rowId);
}

A combination of boolean flags seems to always yield a true value. Am I initializing the dataProcessor object incorrectly? Please help.
Answer posted by Stanislav on Nov 08, 2007 03:39
Actually the logic of code is correct, it work in next way


sendData without params called
    for each updated row checkBeforeUpdate called with related rowID
       sendData called with rowID ( checkBeforeUpdate not executed anymore )

Please check used row IDs, are you using some id which can be threated as nil =>  null, false, 0, "" - such row ID can be threated as empty value and can cause issue described above ( still not reconstructable locally - but possible in theory )

If problem still occurs for you - please provide any kind of sample where problem can be reconstructed ( I need just dataprocessor related js code and used XML, no server code require ) - you can contact directly at support@dhtmlx.com