jsTree Open a branch

后端 未结 8 742
长发绾君心
长发绾君心 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:51

    i found Ted's code working, but had to change it a bit:

     $('#jsTree').bind("open_node.jstree", function (event, data) { 
          if((data.inst._get_parent(data.rslt.obj)).length) { 
            data.inst.open_node(data.inst._get_parent(data.rslt.obj), false,true); 
          } 
        });
    

提交回复
热议问题