0

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

在此处输入图像描述

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"}
            ]
4

1 回答 1

0

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

        var orgchart = new getOrgChart(document.getElementById("people"), {
        primaryFields: ["name"],
        layout: getOrgChart.MIXED_HIERARCHY_RIGHT_LINKS,
        maxDepth: 50,
于 2017-08-19T15:43:59.877 回答