Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Will on Nov 09, 2009 10:26
open dhtmlx forum
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"
Answer posted by Alex (support) on Nov 10, 2009 01:29

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(...);