how to get nodes in tree based on the Level?


I am using Dhtmlx tree in my application. I have two levels in my tree. The first level node is the “Country” For example —(-)India


— Mumbai







----(-) England



Now i want get all the nodes (countries) which is first level(here india, america, brasil,england). how do i get?after that i can get all subitems(cities) by passing country id.

Please help me.




getAllSubItems and getSubItems methods have itemId as a parameter.

The parent of 1st level items is root id (dhtmlXTreeObject(“treeboxbox_tree”,“100%”,“100%”,rootID))

If rootId is 0, items can be got by tree.getSubItems(0) method.