Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Velmurugan on Jul 23, 2009 03:27
open dhtmlx forum
how to get nodes in tree based on the Level?

Hi,
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
---Chennai
--- Mumbai
----Delhi
---(+)America
--Washington
--Californiya
--chicago
----Brasil
----(-) England
---London
---nottinghom

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.

Thanks,
Velmurugan
Answer posted by Alex (support) on Jul 23, 2009 05:02

Hello, 

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.