getorgchart // 使用排序顺序
getorgchart // Sort order using
我的源文件是 xml 文件,我愿意使用布局 MIXED_HIERARCHY_RIGHT_LINKS
.
默认布局保留行顺序,但 MIXED_HIERARCHY_RIGHT_LINKS
不保留:第一行显示在顶部,然后枚举行 bottom-up
。结果,字母顺序被打乱了。
你能解决这个问题吗?提前致谢!
index.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>
init-from-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>
请下载最新版本2.4.6 问题已解决
我的源文件是 xml 文件,我愿意使用布局 MIXED_HIERARCHY_RIGHT_LINKS
.
默认布局保留行顺序,但 MIXED_HIERARCHY_RIGHT_LINKS
不保留:第一行显示在顶部,然后枚举行 bottom-up
。结果,字母顺序被打乱了。
你能解决这个问题吗?提前致谢!
index.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>
init-from-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>
请下载最新版本2.4.6 问题已解决