DHTMLXTree smartRefresh() function

Some time ago, I asked about this feature and was told it made part of the PRO version which I don’t have :frowning:

Nevertheless the following piece of code was sent to me so that I still might be able to simulate my own customSmartRefresh():


             tree.updateItem=function(id,text){ tree.setItemText(id,text); return tree._idpull[id]; };


Basically, this works like a charm, but unfortunately every once in a while I get an Error saying something went wrong, generally when I try to smart refresh a node that already has some of the childs loaded. Also worthy of mentioning; only a few nodes in a given tree get concerned by this problem (it is rather rare actually) but when the problem occurs, on the other hand, than the node concerned never loads. In a tree consisting of the nodes A, B and C for instance, if C doesn’t work - it never works. A and B never raise the exception.

I should notice that the XML returned by the server at such a smart refresh is OK (that’s the first idea one thinks of to check). Something clearly goes wrong on the client side. Any clue?

I know it is hard to make guesses without at least a printout of the debug-code, but I really don’t get any significant error.

Maybe can you provide an alternative for this smartRefresh approach?

Please check that all ids are unique in tree.

Moreover we have attached the latest tree version. You can try to use it instead of the original

dhtmlxtree.zip (24.9 KB)