dhtmlTree Stack Overflow with loadCSVString

when i initialise my tree with a csvstring, i have a stack overflow error.

Is just a test to verify performance of DHMTLXTree.

Thanks



My code is :



var treeCSV="";

for( wi = 1 ; wi < 10 ; wi++ )

{

    treeCSV+=wi.toString()+",0,New Node “+wi+”\n";

    for( wj=0;wj<10;wj++)

    {

     treeCSV+=((wi1000)+(wj100)).toString()+","+wi+",New Node “+wi+”."+wj+"\n";

     for(wk=0;wk<15;wk++)

     {

            treeCSV+=((wi1000)+(wj100)+wk).toString()+","+((wi1000)+(wj100))+",New Node “+wi+”."+wj+"."+wk+"\n";

        }

        

    }

}

tree.loadCSVString(treeCSV);

With such CSV generation logic, the top item will have

1000,1000,some text

so its ID will be equal to its parent ID - which is definitely incorrect - it cause infinity loop and stack overflow in result.
You can change your code as
for(wk=1;wk<15;wk++)
to make it workable

By the way CSV is the slowest format for data loading ( it need to be reconstructed to hierarchy, which takes additional time )
Also, if you are using pro version, be sure to add

tree.enableSmartXMLParsing(true)

before loadCSVString command - it will greatly increase rendering performance.