let treeObj = $.fn.zTree.init($("#tree"), setting, departments);
treeObj.expandAll(true); //默认展开
var nodes = treeObj.getNodes();
if (nodes.length > 0) {
var node = treeObj.selectNode(nodes[0]);//默认选中根节点
}
zTree默认选中根节点,默认展开
最新推荐文章于 2023-10-16 17:36:17 发布