GetOrgChart - Box结构

时间:2017-08-15 09:50:22

标签: getorgchart

问题是,如果孩子大于30件,那么最新的盒子会升到顶部并破坏整个结构。 我带了一些代码示例给你。 请帮助我,我无法详细解释问题因为我的英语非常糟糕。

enter image description here

dataSource: [
                { id: 1, parentId: null, name: "Amber McKenzie"},
                { id: 2, parentId: 1, name: "Ava Field"},
                { id: 37, parentId: 2, name: "Evie Johnson"},
                { id: 3, parentId: 1, name: "Evie Johnson"},
                { id: 4, parentId: 1, name: "Evie Johnson"},
                { id: 5, parentId: 1, name: "Evie Johnson"},
                { id: 6, parentId: 1, name: "Evie Johnson"},
                { id: 7, parentId: 1, name: "Evie Johnson"},
                { id: 8, parentId: 1, name: "Evie Johnson"},
                { id: 9, parentId: 1, name: "Evie Johnson"},
                { id: 10, parentId: 1, name: "Evie Johnson"},
                { id: 11, parentId: 1, name: "Evie Johnson"},
                { id: 12, parentId: 1, name: "Evie Johnson"},
                { id: 13, parentId: 1, name: "Evie Johnson"},
                { id: 14, parentId: 1, name: "Evie Johnson"},
                { id: 15, parentId: 1, name: "Evie Johnson"},
                { id: 16, parentId: 1, name: "Evie Johnson"},
                { id: 17, parentId: 1, name: "Evie Johnson"},
                { id: 18, parentId: 1, name: "Evie Johnson"},
                { id: 19, parentId: 1, name: "Evie Johnson"},
                { id: 20, parentId: 1, name: "Evie Johnson"},
                { id: 21, parentId: 1, name: "Evie Johnson"},
                { id: 22, parentId: 1, name: "Evie Johnson"},
                { id: 23, parentId: 1, name: "Evie Johnson"},
                { id: 24, parentId: 1, name: "Evie Johnson"},
                { id: 25, parentId: 1, name: "Evie Johnson"},
                { id: 26, parentId: 1, name: "Evie Johnson"},
                { id: 27, parentId: 1, name: "Evie Johnson"},
                { id: 28, parentId: 1, name: "Evie Johnson"},
                { id: 29, parentId: 1, name: "Evie Johnson"},
                { id: 30, parentId: 1, name: "Evie Johnson"},
                { id: 31, parentId: 1, name: "Evie Johnson"},
                { id: 32, parentId: 1, name: "Evie Johnson"}
            ]

1 个答案:

答案 0 :(得分:0)

maxDepth选项的默认值为30.在这种情况下,您必须增加它。这是一个例子:

        var orgchart = new getOrgChart(document.getElementById("people"), {
        primaryFields: ["name"],
        layout: getOrgChart.MIXED_HIERARCHY_RIGHT_LINKS,
        maxDepth: 50,