0

我正在尝试在我的页面中使用 getOrgChart 库,但我的浏览器一直坚持它不是一个函数:

这是代码:

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
   <script src="getorgchart.js"></script>
   <link rel="stylesheet" src="getorgchart.css">
<script type="text/javascript"  src="https://www.google.com/jsapi"></script>
      <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
<script>
 $("#orgStaffing").getOrgChart({
                                theme: 'vivian',
                                primaryColumns: ['name','division','project','email'],
                                imageColumn: 'image',
                                gridView: true,
4

1 回答 1

0

在第二封电子邮件“jdoe@company.com”之前添加报价

我试图复制你的问题

    $("#orgStaffing").getOrgChart(
        {
            theme: 'vivian',
            primaryColumns: ['name','division','project','email'],
            imageColumn: 'image',
            gridView: true,
            dataSource: [ 
                    {id: 1, parentId: null, name: 'John Smith', division: 'Inbound', project: 'West', email: 'jsmith@company.com', image: 'johnsmith.jpg'}, 
                    {id: 2, parentId: 1, name: 'Jane Doe', division: 'Inbound', project: 'West', email: 'jdoe@company.com', image: 'janedoe.jpg'}
            ]
        });
html, body {margin: 0px; padding: 0px;height: 100%; overflow: hidden; }
#people {width: 100%;height: 100%; } 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="http://www.getorgchart.com/GetOrgChart/getorgchart/getorgchart.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.getorgchart.com/GetOrgChart/getorgchart/getorgchart.css">
<div id="orgStaffing"></div>

有用

请确保 dataSource 是有效的 JSON 对象。

于 2016-09-13T17:03:29.200 回答