dabeng/OrgChart

(addChildren) : Cannot read properties of undefined (reading 'children')

ngomezleal opened this issue · 0 comments

Hello, I need your helps.

I'm trying add new children in node, and I'm receiving the following error:
Cannot read properties of undefined (reading 'children')

I have the source data like example:
var datasource = {
'name': 'Lao Lao',
'title': 'general manager',
'children': [
{ 'name': 'Bo Miao', 'title': 'department manager' },
{ 'name': 'Su Miao', 'title': 'department manager',
},
]
};
.....
.on('click', function(event, data) {
debugger;
oc.addChildren($(this), { 'children': [
{ 'name': 'Tie Hua', 'title': 'senior engineer' },
]})
});


jquery.orgchart.js
Line: 902

var url = $.isFunction(opts.ajaxURL.children) ? opts.ajaxURL.children($node.data('nodeData')) : opts.ajaxURL.children + $node[0].id;

Help please