I’m also using openAllItems in the afterCall function of loadXML. However, I have an array of trees that I need to refresh, and apparently the tree name cannot be dynamic in the afterCall function.
My code:
for (var i = 1; i < anzBaum; ++i)
{
loadURL = "http://xxx.cfm?spalte=" + i;
Baum[i].deleteChildItems(0);
Baum[i].enableDragAndDrop(true,false);
Baum[i].loadXML(loadURL,function(){Baum[i].openAllItems(0);});
}
throws error “‘Baum[…]’ is Null oder not an Object”. I tried to pass “i” as a parameter in the function call:
Calling an external function as afterCall function and passing “i” as parameter gives no error, but doesn’t open the items:
function openAfterLoading(n)
{
Baum[n].openAllItems(0);
}
[...]
Baum[i].loadXML(loadURL,openAfterLoading(i));
What can I do to open all items after the tree refresh?
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan