link in userdata field of treexml fails


I want to have a http link in a treenode and I use the userdata field in combination with tree onclickhandler to get it to work. Somehow this doesn’t work as I expected. I use following code:

Tree XML:>


Tree definition with Onclick handler:

     tree0=new dhtmlXTreeObject(“mytree”,“100%”,“100%”,0);






tree0.setOnClickHandler(doOnClick); function doOnClick(nodeId){ var myUrl = tree0.getUserData(nodeId,‘myurl’);; }


What happen is that javascript variable myUrl gets the value: undefined. It is not filled with the userdata as defined in the XML

What goes wrong here?



It should be "> ".
When you click on “parent node text” item page has to be loaded.
If you want to add user data for “Childenode text” you should use following xml:…


If problem persists - please provide more details  - what issue you’ve got ? how it should work ? etc.

Thanks for your answer. Sorry for the typo (>) but the problem persists. Javascript variable myUrl stays undefined, even when I put in a very simple userdata text such as blabla. The userdata is supposed to be related to the parent node so the xml below should be correct to my opinion:



I now, have extracted  the extra information that I need from the ID tag. This workaround solves the problem for now.

Please check attached sample , it use code and XML similar to used in your case, and it works correctly.
Problem may be caused by version of dhtmlxTree which you are using ( if you are using not latest code - please try latest one ) (48.4 KB)

I replaced my code with yours and it works. Thanks !