javascript - orgchart getOrgChart not a function -
i'm trying use getorgchart library in page, browser keeps insisting not function:
here's code:
<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,
add quote before second email 'jdoe@company.com'
i have tried replicate issue
$("#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>
it works
please make sure datasource valid json object.
Comments
Post a Comment