weixin_33724659 2018-02-20 03:21 采纳率: 0%
浏览 112

Dabeng OrgChart格式数组

i have Output Like this from data.php, iam use https://github.com/dabeng/OrgChart

[
{"title":"306","relationship":"30","name":"HARDWARE & ","parentid":"30"},
{"title":"296","relationship":"476","name":"IT  DOCUMENTATION","parentid":"476"},
{"title":"596","relationship":"30","name":"MAGANG MIS DEPARTMENT","parentid":"30"},
{"title":"345","relationship":"30","name":"NETWORK SYSTEM STAFF","parentid":"30"},
{"title":"184","relationship":"476","name":"PROGRAM ANALYST","parentid":"476"},
{"title":"46","relationship":"476","name":"PROGRAMMER","parentid":"476"},
{"title":"476","relationship":"30","name":"SOFTWARE DEVELOPMENT ","parentid":"30"},
{"title":"580","relationship":"30","name":"SYSTEM & NETWORK S","parentid":"30"},
{"title":"604","relationship":"580","name":"SYSTEM & SECURITY ","parentid":"580"},
{"title":"48","relationship":"306","name":"TECHNICAL SUPPORT","parentid":"306"}
]

from this ajax

    $('#chart-container').orgchart({
        'data' : 'data.php',
        'nodeContent': 'title',
        'nodeId': 'id',
        'exportButton': true,
        'exportFilename': 'MyOrgChart'
    });

But This Not Working ? thks

Yapp This the result

  • 写回答

2条回答 默认 最新

  • weixin_33728268 2018-03-22 03:10
    关注

    replace 'data.php' as an ajax response with json format not a URL. Also, your relationships should be in "1/0" of "111" = "hasParent,hasSibling,hasChildren" not the parentid.

    评论

报告相同问题?