-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix-bug: drag&drop is not working in the hybrid chart
- Loading branch information
Showing
9 changed files
with
155 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Organization Chart Plugin</title> | ||
<link rel="icon" href="img/logo.png"> | ||
<link rel="stylesheet" href="css/jquery.orgchart.css"> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<style type="text/css"> | ||
#chart-container { height: 600px; } | ||
.orgchart { background: #fff; } | ||
</style> | ||
</head> | ||
<body> | ||
<div id="chart-container"></div> | ||
|
||
<script type="text/javascript" src="js/jquery.min.js"></script> | ||
<script type="text/javascript" src="js/jquery.orgchart.js"></script> | ||
<script type="text/javascript" src="js/json-digger.js"></script> | ||
<script type="text/javascript"> | ||
$(function() { | ||
|
||
var datascource = { | ||
'id': '1', | ||
'name': 'Lao Lao', | ||
'title': 'general manager', | ||
'children': [ | ||
{ 'id': '2', 'name': 'Bo Miao', 'title': 'department manager' }, | ||
{ 'id': '3', 'name': 'Su Miao', 'title': 'department manager', | ||
'children': [ | ||
{ 'id': '4', 'name': 'Tie Hua', 'title': 'senior engineer' }, | ||
{ 'id': '5', 'name': 'Hei Hei', 'title': 'senior engineer', | ||
'children': [ | ||
{ 'id': '6', 'name': 'Pang Pang', 'title': 'engineer' }, | ||
{ 'id': '7', 'name': 'Dan Dan', 'title': 'UE engineer' , | ||
'children': [ | ||
{ 'id': '8', 'name': 'Er Dan', 'title': 'engineer' }, | ||
{ 'id': '9', 'name': 'San Dan', 'title': 'engineer', | ||
'children': [ | ||
{ 'id': '10', 'name': 'Si Dan', 'title': 'intern' }, | ||
{ 'id': '11', 'name': 'Wu Dan', 'title': 'intern' } | ||
] | ||
} | ||
]} | ||
] | ||
} | ||
] | ||
}, | ||
{ 'id': '12', 'name': 'Hong Miao', 'title': 'department manager' }, | ||
{ 'id': '13', 'name': 'Chun Miao', 'title': 'department manager', | ||
'children': [ | ||
{ 'id': '14', 'name': 'Bing Qin', 'title': 'senior engineer' }, | ||
{ 'id': '15', 'name': 'Yue Yue', 'title': 'senior engineer', | ||
'children': [ | ||
{ 'id': '16', 'name': 'Er Yue', 'title': 'engineer' }, | ||
{ 'id': '17', 'name': 'San Yue', 'title': 'UE engineer' } | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
|
||
var oc = $('#chart-container').orgchart({ | ||
'data' : datascource, | ||
'nodeContent': 'title', | ||
'draggable': true, | ||
'verticalLevel': 3 | ||
}); | ||
|
||
oc.$chart.on('nodedrop.orgchart', function(event, extraParams) { | ||
console.log('draggedNode:' + extraParams.draggedNode.children('.title').text() | ||
+ ', dragZone:' + extraParams.dragZone.children('.title').text() | ||
+ ', dropZone:' + extraParams.dropZone.children('.title').text() | ||
); | ||
}); | ||
|
||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters