我已经在jsTree-v3.3.7中使用了唯一的插件,如果用户重命名或创建一个已经存在的节点,我希望收到一条警报消息。有什么建议吗?
如下所示,当在唯一的插件中发生重复但不起作用时,我添加了回调
$("#jstree").jstree({
"core": {
"check_callback": true,
"data": data,
"themes" : { "stripes" : true },
},
"plugins" : [ "unique"],
"unique": {
"duplicate": function (name, counter) {
alert('duplicate node added: ' + name);
//return name; // This would just return the duplicate name to use as the node is created
}
},
});