How to get the ID for each node or item?

Hi all,
I need to drag and drop nodes between two trees, so i need to get the ID of each node in a tree to save all IDs for a tree to DB?
i know we can get some IDs by calling API ,such as ‘tree.attachEvent(“onBeforeDrag”,function(sId){alert(sId);})’, however browser reporteded such an error ‘document.getElementById(sId) is null’ when using sId that was indeed poped up by alert box and I can’t see any ID attribute for all tags on tree via firebug. Frankly speaking, it is very hard for me to read implementation code to know the whole implementation process, so I become confused.
Can anyone tell me how to implement it? Is there any API I can call?
Thx in advance.

Jeff

Hello,

IDs of tree items can’t be used in getElementById method. An ID identifies tree item (JS object) and doesn’t relate to html element. You can get all information about a certain node by tree API. The whole methods list is:

docs.dhtmlx.com/doku.php?id=dhtm … _toc_alpha

For example you can use getAllSubItems method to get IDs of all child items of a certain node:
docs.dhtmlx.com/doku.php?id=dhtm … llsubitems

Hi,
Thanks for your help.