How do I open all nodes in jquery Jstree?

前端 未结 9 1918
感情败类
感情败类 2021-02-05 00:07

I am using the following code:

$("#treeview").jstree();
$("#treeview").jstree(\'open_all\');

With the following html:

9条回答
  •  面向向阳花
    2021-02-05 00:44

    I am using version 3 of jstree and Chrome. The loaded event did not work for me, but the ready event did, even after the jstree instance was created:

    $('#treeview').on('ready.jstree', function() {
        $("#treeview").jstree("open_all");          
    });
    

    http://www.jstree.com/api/#/?q=.jstree%20Event&f=ready.jstree

提交回复
热议问题