Javascript Js树:我的配置有问题吗?
我在jstree配置中做了一些错误的事情,但我找不到什么。 它阻止我删除节点,当我使用默认配置删除id=106的节点时,它可以正常工作。所以至少我知道我的html是正确的 这是工作默认代码Javascript Js树:我的配置有问题吗?,javascript,jquery,html,jstree,Javascript,Jquery,Html,Jstree,我在jstree配置中做了一些错误的事情,但我找不到什么。 它阻止我删除节点,当我使用默认配置删除id=106的节点时,它可以正常工作。所以至少我知道我的html是正确的 这是工作默认代码 $('#jstree').jstree({ core : { check_callback : true } }); var t = $('#jstree').jstree(true); t.select_node('106'); t.delete_node(['106']); 这是我的配置 $("#js
$('#jstree').jstree({ core : { check_callback : true } });
var t = $('#jstree').jstree(true);
t.select_node('106');
t.delete_node(['106']);
这是我的配置
$("#jstree").jstree({
"core": {
"animation": 0,
"check-callback": true,
"themes": {
"icons": true,
"stripes": true,
}
},
// plugins
"plugins": [
"contextmenu", "types"
],
"types": {
"root": {
"icon": "glyphicon glyphicon-tree-deciduous"
},
"folder": {
"icon": "glyphicon glyphicon-tags"
},
"tag": {
"icon": "glyphicon glyphicon-tag"
},
},
// modify the contextmenu content with customMenu() function
"contextmenu": {
"items": function($node) {
return {
"Create": {
"separator_before": false,
"separator_after": false,
"label": "Create Folder",
"action": function(obj) {
this.node_create();
}
},
"Rename": {
"separator_before": false,
"separator_after": false,
"label": "Rename",
"action": function(obj) {
this.node_rename();
}
},
"Remove": {
"separator_before": false,
"separator_after": false,
"label": "Delete",
"action": function(obj) {
var t = $('#jstree').jstree(true);
t.select_node('106');
t.delete_node(['106']);
}
}
};
}
}
});
我查了其他的答案,但没有帮助。
我发现了问题所在,请查看我的答案。您的代码有一个错误,可能无法解决问题,但可以提供帮助。 见: 我希望能帮你解决问题!:) 我发现了错误 我得换衣服
"check-callback": true,
到
可能的副本无法回答我的问题。@Keutelvocht抱歉,我无法解决您的问题,但祝您好运!:)
"check-callback": true,
"check_callback": true,