Tree refreshItem() not working

I am loading a tree hierarchy via an XML fetch to my server. When the user does something to alter the tree, I want to refresh the tree by calling:

tree.refreshItem(‘xxx’);

where ‘xxx’ is the id for the main root of the tree.

When I invoke this, I get a javascript exception on this line:
TypeError: str.indexOf is not a function

Note: I have tried with no parameters with the same result.
tree.refreshItem()

What am I doing wrong (besides choosing the wrong career :slight_smile: )?

refreshItem works only in dynamic trees and uses script that is defined in the setXMLAutoLoading method as xml source. Here is the sample

dhtmlx.com/docs/products/dht … fresh.html

Another approach to reload tree is:

tree.deleteChildItems(0);
tree.loadXML(url);

Thank you, the alternate approached worked :slight_smile: