Commit 7ec45fab authored by frank.xa.zhang's avatar frank.xa.zhang

add demo for orgChart -- frank

parent 2541060b
(function ($) {
$(function () {
var westData = {
'name': 'Cayman 1 LP',
'wins': '1',
'children': [
{
'name': 'Cayman 2 Limited', 'wins': '2',
'children': [
{
'name': 'BVI 1 Limited', 'wins': '3',
},
{ 'name': 'Hong Kong 1 Limited', 'wins': '4' }
]
}
]
};
$(function () {
var westData = {
'name': 'Cayman 1 LP',
'wins': '1',
'children': [
{
'name': 'Cayman 2 Limited', 'wins': '2',
'children': [
{
'name': 'BVI 1 Limited', 'wins': '3',
},
{'name': 'Hong Kong 1 Limited', 'wins': '4'}
]
}
]
};
var ocWest = $('#chart-western').orgchart({
'data': westData,
'nodeContent': 'name',
'direction': 't2b',
'createNode': function ($node, data) {
if (data.wins === "1")
$node.children('.title').html('<img src="A.png" style="width:100%">');
else
$node.children('.title').html('<img src="2.png" style="width:100%">');
}
var ocWest = $('#chart-western').orgchart({
'data': westData,
'nodeContent': 'name',
'direction': 't2b',
'createNode': function ($node, data) {
if (data.wins === "1") {
$node.children('.title').html('<img src="A.png" style="width:100%">');
$node.hide();
}
else
$node.children('.title').html('<img src="2.png" style="width:100%">');
},
'initCompleted': function ($chart) {
console.log($chart);
$chart.children().children('.lines').hide();
}
});
});
});
})(jQuery);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment