jsTree Open a branch

后端 未结 8 761
长发绾君心
长发绾君心 2021-02-02 11:07

I am using the JQuery plugin jsTree, http://www.jstree.com/ I am able to expand the whole tree with the following method:

$(\"#tree\").jstree(\"open_all\");
         


        
8条回答
  •  爱一瞬间的悲伤
    2021-02-02 11:46

    None of previous worked for me, so I have created this code, and it works like a charm :)

    $('#tree').on('open_node.jstree', function (event, data) { 
        if(data.node.parent !== "#") { 
            data.instance.open_node(data.node.parent); 
        } 
    });
    

提交回复
热议问题