Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ngomezleal opened this issue May 20, 2023 · 0 comments
Open

Comments

@ngomezleal
Copy link

ngomezleal commented May 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant