开发者

Move all the children of a node to another node

Suppose I have a tree with nodes and sub-nodes. I want to move all th开发者_JAVA技巧e 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜