[ { "children": [ { "children": null, "id": "615365ab-8295-4b5c-aef2-9dfc35a13d35", "text": "User A", "icon": "/Content/jsTree/boss.png", "state": { "opened": false, "disabled": false, "selected": true, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { } }, { "children": null, "id": "81a30d6a-2a82-40c2-9a6d-3acd8d4b576a", "text": "User B", "icon": null, "state": { "opened": false, "disabled": false, "selected": true, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { } }, { "children": null, "id": "a138853c-539d-467d-ad51-2a5752e198f6", "text": "User C", "icon": null, "state": { "opened": false, "disabled": false, "selected": false, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { } }, { "children": null, "id": "b188b538-bda9-4dd0-bf42-e1d75ed40284", "text": "User D", "icon": null, "state": { "opened": false, "disabled": false, "selected": true, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { } }, { "children": null, "id": "87a919ab-7c66-4222-b9a0-880dea4b2226", "text": "User E", "icon": null, "state": { "opened": false, "disabled": false, "selected": true, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { } }, { "children": null, "id": "0947fb5a-c224-431d-8b83-6aae8a409311", "text": "User F", "icon": null, "state": { "opened": false, "disabled": false, "selected": true, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { } }, { "children": null, "id": "66df86a6-d1f7-475b-a11d-44394163f06e", "text": "User G", "icon": null, "state": { "opened": false, "disabled": false, "selected": true, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { } }, { "children": null, "id": "_e0bf4d1e-4f34-4c20-9ccf-7ac40c2ee522", "text": "User H", "icon": "/Content/jsTree/boss.png", "state": { "opened": false, "disabled": false, "selected": true, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { "class": "disabled couser", "rel": "nochb" } } ], "id": "31", "text": "Department", "icon": "/Content/jsTree/dep.png", "state": { "opened": false, "disabled": false, "selected": false, "undetermined": false }, "_parent_": null, "li_attr": null, "a_attr": { "class": "strong" } }]$("#maintree")
.on("open_node.jstree", function (e, data) {
$('div#maintree li > a[rel="nochb"] i.jstree-checkbox').remove();
$('i.jstree-themeicon-custom').css("background-size", '16px 16px');
})
.on("load_node.jstree", function (e, data) {
$('div#maintree li > a[rel="nochb"] i.jstree-checkbox').remove();
$('i.jstree-themeicon-custom').css("background-size", '16px 16px');
})
.on("changed.jstree", function (e, data) {
if (data.node != undefined) {
console.log($("li#" + data.node.id).parents().eq(1).attr("id"));
if ($('div#maintree li#' + data.node.id + ' > a').hasClass('disabled')) {
$('div#maintree').jstree("select_node", '#' + data.node.id);
}
else {
$.ajax({
type: "GET",
url: SetMyUser,
cache: false,
data: { user: data.node.id,
node: (data.node.children.length == 0 ? $("li#" + data.node.id).parents().eq(1).attr("id") : data.node.id),
state: (data.action == 'select_node'),
children: JSON.stringify(data.node.children)
}
}).success(function (result) {
}).error(function (xhr, status, message) {
});
}
}
})
.jstree({
"core": {
"data": {
"url": GetTreeData,
'data': function (node) {
return { 'id': node.id === '#' ? 0 : node.id };
}
},
'strings': {
'Loading ...': 'Betöltés ...'
},
'animation': false
},
"plugins": ['checkbox']
});
.on("changed.jstree", function (e, data) {
if ($('div#maintree li#' + data.node.id + ' > a').hasClass('disabled')) {
$('div#maintree').jstree("select_node", '#' + data.node.id);
}
Remove this handler and see if you still get the error. Basically you when something is selected, you trigger another select, which in turn triggers changed, and so on. In fact - remove all ".on" handlers and only leave .jstree(... - that is the only way to check if jstree is causing the issue or your code.
Best regards,
Ivan