A case-sensitive string representing the event type to listen for.
The object that receives a notification when an event of the specified type occurs. This must be a JavaScript function.
Occurs when a node has been added by addNode method.
var chart = new OrgChart('#tree', {});
chart.onAddNode((args) => {
//return false; to cancel the operation
});
new added data node
The onDrag event occurs when a node is dragged. enableDragDrop option has to be turned on.
var chart = new OrgChart('#tree', {});
chart.onDrag(() => {
//return false; to cancel the operation
});
dragged node id
The onDrop event occurs when a node is dropped. enableDragDrop option has to be turned on.
var chart = new OrgChart('#tree', {});
chart.onDrop(() => {
//return false; to cancel the operation
});
dragged node id
draging element
dropped node id
Occurs when a node has been removed by removeNode method.
var chart = new OrgChart('#tree', {});
chart.onRemoveNode((args) => {
//return false; to cancel the operation
});
node id
parent ids and sub tree parents ids that needs to be updated on the server. For example if you remove a node that has children all chilren nodes will change their pid to the parent node id of the removed node.
Occurs when the node data has been updated by updateNode method.
var chart = new OrgChart('#tree', {});
chart.onUpdateNode((args) => {
//return false; to cancel the operation
});
new node data
old node data
Can update link
child id
parent id
Removes specified node from nodes collection, redraws the chart and fires remove event.
identification number of the node
called at the end of animation
indicates if the remove event will be called or not
Generated using TypeDoc
The on() method of the OrgChart class sets up a function that will be called whenever the specified event is delivered to the target. *