Questions about tree nodes

Hi, I have two quick questions about tree nodes.

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

Thanks

Hi
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