vakata / jstree

jquery tree plugin
http://jstree.com
MIT License
5.15k stars 1.38k forks source link

Unique duplicate function not working #2740

Closed duyetkaka2110 closed 1 year ago

duyetkaka2110 commented 1 year ago

hi i need your help i build tree with jstree 3.3.15. But unique custom duplicate function not working (console.info). $('#jstree').jstree({ 'core': { 'data': categories, "animation": 0, "check_callback": true }, "unique": { case_sensitive: true, trim_whitespace: true, duplicate: function(name, counter) { console.info(name) return name + "のコピー"; // This would just return the duplicate name to use as the node is created }, "error_callback": function(n, p, f) { console.info("Duplicate node " + n + " with function " + f + "!"); } }, "plugins": [ "unique", "contextmenu", "dnd", "state", "wholerow" ], })

vakata commented 1 year ago

Here is a demo - seems to work fine. Keep in mind there is no option called error callback. https://jsfiddle.net/45xc1rd2/