Topic: adding nodes manually

Hello, Moro!
Could you please help me to find out where a'm wrong. I want to manually add some nodes, like this:

function formBranch(root){
    if(root){
        var newNode=new Mif.Tree.Node({
            parentNode: root,
            tree: tree2
            }, {property:{name: 'node1'}});
        tree2.add(newNode, root, 'inside');

        var newNode2=new Mif.Tree.Node({
            parentNode: newNode,
            tree: tree2
            }, {property:{name: 'node1.1'}});
        tree2.add(newNode2, newNode, 'inside');
    }
}

first node (newNode) adds normally, but second doesn't. It falls in getDOM function. There after

var node=$(this.tree.DOMidPrefix+this.UID);

node is still null. What do you think about it?

Re: adding nodes manually

because Tree::add first argument must be node options only, but not node. In latest rev (30) added support for node as first argument Tree::add function. So your example should work with latest rev.

Re: adding nodes manually

i'm very sorry, but I still have this problem. I think something wrong with

...this.UID...

at the second time it returns the uid that cannot be found. I tried to change it manually in the debug(to value that was expected) and second node is drawn, but with extra vertical line from root node. Could you please help me to find out what is wrong?

Re: adding nodes manually

works for me. See Another add node demo

Re: adding nodes manually

I'm sorry, but i see only "Add node" example there. After some debuging, i find that that Mif.Tree.Node constructor runs 2 times for node - once at the moment of creation and the second time when using add function. Every time it gets different UIDs.
I think its my mistake, a hope you tell me where i'm wrong

Re: adding nodes manually

clear cache and try again

Re: adding nodes manually

It works!... after i updated js libs properly. Sorry for my stupid questins, Moro. And thanks for your patience.