i.e Treeview getChildren method working only when nodes are expanded

R

rao

I am trying to get sub nodes for for clicked node using getChildren()
method as shown below. I am getting javascript exception error
(subtree.null )when nodes are not expanded. The code works only when
nodes are expanded.
any help is greatly appreciated. I am getting this error while
accessing the
property currentChild.getAttribute("Text").

Thanks
rao


Thanks
rao



<SCRIPT language="jscript">
// Walk through the tree.
function walkChildren(arrayChildren){
var currentChild;
for (var i = 0; i < arrayChildren.length; i++){
currentChild = arrayChildren;
childrenDIV.innerText += "[" +
currentChild.getAttribute("Text") + "]";
walkChildren(currentChild.getChildren());
}
}
</SCRIPT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top