jsTree - render all nodes before they are expanded?

折月煮酒 提交于 2019-12-06 11:11:18

No it can not be disabled - only visible nodes are kept in the DOM, you can however do what is recommended in the docs and work with the internal jstree model to retrieve the titles.

container.on("changed.jstree", function (e, data) {
    var i,
        list = "<ul>";
        children = data.instance.get_node(data.selected[0]).children;
    for (i = 0; i < children.length; i++) {
        list += "<li>" + data.instance.get_node(children[i]).text + "</li>";
    }
    list += "</ul>";
    jQuery(".childNodes").html(list);
});

If you want to display all descendants (not only immediate) substitute:
data.instance.get_node(data.selected[0]).children
with:
data.instance.get_node(data.selected[0]).children_d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!