我的来源是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-从-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>
答案 0 :(得分:1)
请下载最新版本2.4.6问题已解决