Tree showItem doesn't work

Hello i have a tree and when set

$$(“tree”).showItem(id);

it doesn’t work but i have any error

Which result do you expect after executing the above command?

showItem adjusts scrolls to move an item into a visible part of a tree, it will not open tree branches or do anything else to make the item visible. So if this item was in the closed branch, it will not be visible after showItem command.

ok if i want to open all the branch till the item’s id?
Thanks

You can use the following approach to open an item and all its parents:

function showItem(id){
    var itemId = id;
    while(id){
        $$("tree").open(id);
        id = $$("tree").getParentId(id);
    }
    $$("tree").showItem(itemId);
}

Thanks so much guys!