Questions about tree nodes


Hi, I have two quick questions about tree nodes.

list is a list of items’ ID’s
var ids=list.split(’,’);
var pos=ids.length-1;
tree.setCheck(list[pos-1],true); //doesn’t work
tree.setCheck(list[pos],true); //doesn’t work
var ids=list.split(’,’);
var pos=ids.length-1;
for(var i = 0; i < len; i++) //only opens ids[0],??
tree.setCheck(ids[pos-1],true); //doesn’t work
tree.setCheck(list[pos],true); //doesn’t work



You open items dynamically, so you need an event handler onOpenDynamicEnd to check your nodes:

var checkIds = "..."; tree.attachEvent("onOpenDynamicEnd", function(){ if(checkIds){ // some code checkIds = null; } })
Where some code is your code for checking nodes.


In the second case you need to use onOpenEnd event handler with similar approach