Forum Discussion
Ryan_Moran
11 years agoValued Contributor
From the eror your posted it sounds like you can't expand it because it has no items contained in that particular tree. I will give you an example of a similar control in which I had previously encountered that issue and hopefully that gives you an idea of what you need to do to get this working:
JScript example--
JScript example--
function clicknode(o,i,c,k,p){
if (!p){o.collapseall();}
for (var n = 0;n < o.nodes.count;n++){
if (lcase(o.nodes.item(n).text.olevalue) == lcase(i)){
if (p){p.click(o.nodes.item(n).get_Bounds.X + 15,o.nodes.item(n).get_Bounds.Y + 15);}
else{o.click(o.nodes.item(n).get_Bounds.X + 15,o.nodes.item(n).get_Bounds.Y + 15);}
return;
}
//drill down
if (o.nodes.item(n).nodes.count > 0){ //you need something like this here
o.nodes.item(n).expand(); //syntax here will vary slightly for you
if (!p){clicknode(o.nodes.item(n),i,'','',o);}
else{clicknode(o.nodes.item(n),i,'','',p);}
}
}
}