rkannan
Newbie
Posts: 1
Registered: 8/9/2005
Member Is Offline
|
| posted on 8/9/2005 at 08:24 PM |
|
|
Is it possible to get the captions of the children of a given item ?
Hi,
I would like to get the captions of the children of the selected item ? Is there any builtin Javscript function to achieve that ? I would be happier
if I could get the captions of only the leaf items for the selected item.
Thanks in advance for any help provided.
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 9/6/2005 at 11:11 AM |
|
|
Once you get tree_item object (say it's o_item var) you could:
// get access to its children
for(var i=0; i<o_item.a_children.length; i++) {
o_child = o_item.a_children;//get child tree_item object
alert(o_child.a_config[0]);// get caption of the child
...
if(o_child.a_children.length) {
//child is a node
} else {
//child is a leaf
}
}
|
|
|