Search code examples
jquerygetorgchart

getorgchart allowed maximum node


I'm using getorgchart and i have a tree which has 86 nodes and i want to display them vertically. But it does not shown after 30. node. It must be like that:

  • Parent Node
  • 1.Node
  • 2.Node
    1. Node
  • ...
  • ...
  • ...
    1. Node

But it seems like

  • Parent Node
  • 30-31-32-....-86.node
  • 1.Node
  • 2.Node
  • 3.Node
  • ...
  • ...
  • ...
    1. Node

Sorry for my english.

here is my code:

 $.getJSON("/profile/getSchema/" + id, function (source) {
    $('#waiting').hide();

    var peopleElement = document.getElementById("people");
    var _layout;
    var _scale = 0.5;

    if (source.length > 1)
    {
        _layout = getOrgChart.MIXED_HIERARCHY_RIGHT_LINKS
        _scale = "auto";
    }
            var orgChart = new getOrgChart(peopleElement, {
                expandToLevel: 100,
                enableExportToImage: true,
                clickNodeEvent: clickHandler,
                enableZoomOnNodeDoubleClick: true,
                layout: _layout,
                primaryFields: ["Name", "N", "NShort", "Email"],
                photoFields: ["Image"],
                scale: _scale,
                enableEdit: false,
                enableDetailsView: true,
                dataSource: source
            });

            //$('.get-down').next().remove();
        });

Solution

  • You can set the maxDepth to 100 and will work

    Here is an example

    var orgChart = new getOrgChart(peopleElement, { maxDepth : 100,