I have a result from a webservice (as arraycollection)
i can simply tell that it containts categories that have id,name,parentid
as you see that parentid points that if that category is belong to an id .
1-----cat1------0 <<<< 0 means that it is a main category
2-----cat_sub----1 <<<<< that category is sub cat. of cat1
so can i bind that data to tree in a simple way?
What must i do ? I dont want to loop at all and look if it's parent or main and where it belongs to and add to tree.
Is there a simple way?
there are two variant to create tree from this data.
First is to loop array and create childrens to all objects.
The second variant is to create dataDescriptor for your tree. So you need to implement function getChildren to one node. For root you should return all nodes with parentID = 0, for others nodes with parentID = ID of current node.
See docs for more info.
you have any doc or link ? :=)
thx so much