I want to create a Folder/file using function in jsTree

1.2k Views Asked by At

I want to create a new file/folder in jstree using javascript function like

function create_new_node(...){
// this is external function 
// append to current selected node in the tree ( I have it ).
//... etc
}

the jstree script :

$('#tree').jstree(..) 
.on('create_node.jstree', function (e, data) {
    console.log("create_node.jstree",data);

//this trigger when item created
  })
});

How I can do that ... ?

1

There are 1 best solutions below

0
On BEST ANSWER

I found the answer:

    $('#tree').jstree("create_node", "parent_id", function(e,data){
    console.log('hi', data);
});