我的源是一个xml文件,我愿意用layout MIXED_HIERARCHY_RIGHT_LINKS
。
默认布局保留行顺序,但MIXED_HIERARCHY_RIGHT_LINKS
不会:第一行显示在顶部,然后行被枚举bottom-up
。结果,字母顺序被破坏了。
你能解决这个问题吗?提前致谢!
索引.html
<!DOCTYPE html><html>
<head>
<script src="getorgchart/getorgchart.js"></script>
<link href="getorgchart/getorgchart.css" rel="stylesheet" />
</head>
<body>
<div id="people">
<script type="text/javascript">
var peopleElement = document.getElementById("people");
var orgChart = new getOrgChart(peopleElement, {
primaryFields: ["name", "service", "title", "phone"],
layout: getOrgChart.MIXED_HIERARCHY_RIGHT_LINKS,
dataSource: "init-from-xml.xml",
expandToLevel: 4
});
</script>
</div>
</body>
</html>
初始化从 xml.xml
<?xml version="1.0" encoding="utf-8" ?>
<people>
<person name="Met" title="" phone="" image="" service="">
<person name="Jamez" title="" phone="" image="" service=""></person>
<person name="Kirk" title="" phone="" image="" service=""></person>
<person name="Lars" title="" phone="" image="" service=""></person>
<person name="Rob" title="" phone="" image="" service=""></person>
</person>
</people>