简体   繁体   中英

why I am getting this error “undefined is not a function ”

I am using copy node functionality of jstree .While using that I am getting this "error undefined is not a function".I need to copy "b" having all childs node on same level. Here is fiddle.I am reading Api from here http://www.jstree.com/api/

here is my fiddle http://jsfiddle.net/fuu94/195/

$("#copyNode").on("click", function () {
     $('#tree').jstree(true).copy_node ("#b")

});

Please read the API carefully. It points out that you have to specify the new parent of the copied node. For example this statement copies the node b under root0 :

$('#tree').jstree(true).copy_node ("#b","root0")

Also here's the fiddle: http://jsfiddle.net/NLyW8/2/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM