Search code examples
layoutgetorgchart

getorgchart // Sort order using


My source is an xml file, and I'm willing to use the layout MIXED_HIERARCHY_RIGHT_LINKS.

The default layout preserves the lines order, but MIXED_HIERARCHY_RIGHT_LINKS doesn't: the 1st line is displayed on top, then lines are enumerated bottom-up. As a result, the alphabetical order is broken.

Could you fix this behaviour? Thanks in advance!

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> 

enter image description here


Solution

  • Please download the latest version 2.4.6 the issue has been addressed