在jstree初始化之前绑定方法
.bind("loaded.jstree", function (e, data) {
data.inst.open_all(-1); // -1 opens all nodes in the container
}
)
例如:
$(function () {
$("#demo")
.bind("loaded.jstree", function (e, data) {
data.inst.open_all(-1); // -1 opens all nodes in the container
})
.jstree({
// 你的jstree的设置
})