- 默认展开第二级菜单
var zTreeObj = $.fn.zTree.init(
$("#menuTree1"),
setting,
resource.data
);
//展开二级菜单、
var nodes = zTreeObj.getNodes();
for (var i = 0; i < nodes.length; i++) {
//设置节点展开
zTreeObj.expandNode(nodes[i], true, false, true);
}
来源:oschina
链接:https://my.oschina.net/u/3734228/blog/3186650