views:

249

answers:

1

Hello.

Suppose I have a tree with nodes and sub-nodes. I want to move all the children of a node to another node ("under" the destination node, among the already existing children). Also, it would be nice if this didn't generate a move_node event. Can anyone help?

Thank you in advance.

A: 

Solved

I have tested and this works:

.bind("remove.jstree", function (e, data) {
        data.rslt.obj.find("> ul > li").each(function () {
                data.inst.move_node(this, "#rhtml_4", "last");
        });
        // possibly sync to DB here
});

Credit goes to vakata: http://groups.google.com/group/jstree/browse_thread/thread/4982d1518a9fa90?hl=en

nc3b