jsTree Open a branch

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

        // Expand pasted, dragged and dropped node for jstree 3.3.1
            var objtree = $('#jstree');
            objtree.bind('paste.jstree', function(e, d) { objtree.jstree('open_all', '#' + d.parent); });
            $(document).bind('dnd_move.vakata', function(e, d) { objtree.jstree('open_all', $(d.event.target).closest('.jstree-node').attr('id')); });
            $(document).bind('dnd_stop.vakata', function(e, d) { objtree.jstree('open_all', $(d.event.target).closest('.jstree-node').attr('id')); });
    

提交回复
热议问题