Problem with setXMLAutoLoading function looping

I have a tree that was brought to its knees when presented with 29,000 rows. The data is represented in three levels. The highest level had about 100 nodes at most, the second level varies but had as many as 900+ nodes under one of the top level nodes. The third level is always the same number of nodes, about 10. I changed my process to query the table and bring back only the highest level at start up and use the setXMLAutoLoading method when the user clicks the plus sign to expand the node. By itself that worked okay for those highest level nodes that did not have too many secondary nodes but when you click that 900+ sub-node item (900+ * 10) it would fail again. So, I am trying to use setXMLAutoLoading again to so that only 900+ items are added when you click that item and you then have to click the secondary item you want to see the 10 items below it. What I’ve got loads level 1 okay and even loads level 2 okay but when you click on the level 2 plus sign, it starts to loop through the setXMLAutoLoading function infinitely. I’ve stepped through the Javascript and it enters the function, prepares the loadXML statement and then executes the loadXML method and then repeats. I realize it is the loadXML method inside the setXMLAutoLoading function that is causing it to repeat but I can’t get anything to load without so I have it in there. Also, if it is looping when I click level 2, I can’t figure out why it is not looping when I click level 1. Why would the loadXML method cause the function to repeat only at level 2 and not level 1? thanks, Jim Dixon

We need the example of tree initialization.

Autoloading function is called only for items with child=“1” attribute when they are opened for the first time.