Tree Refresh

when calling any of the following:



tree.refreshItem();

tree.refreshItem(0);

tree.refreshItem(‘0’);



I get the following error:



File: dhtmlxAjax/codebase/dhtmlxcommon.js

Line: 31

Error: str.indexOf is not a function

Name: “TypeError”


Hello,


refreshItem works only with autoloading. It gets the id of updated branch. So, if you update the whole tree, the correct call is tree.refreshItem(0);


If you don’t use autoloading, you can use smartUpdateBranch method (only in PRO edition) or reload tree:


tree.deleteChildItems(0);


tree.loadXML(…);