Tree updating data problem

I have a problem when updating and reloading data in the Tree and TreeGrid. The data loading is fine, but I can’t access the nodes by clicking on the + buttons or by using grid.openItem(n).
Hopefully someone has a solution, I am using the professional edition v.2.5 build 90814.

I have tried both

tree.deleteChildItems(0); tree.loadXML("data");

AND

tree.setXMLAutoLoading("data"); tree.refreshItem(0);
Thanks

You should call deleteChildItems() only after all items are loaded:

tree.loadXML(“data”,function(){
tree.deleteChildItems(0);
});