1

I have created a very simple jstree.

On click of a link I am calling createNode() function. It does uses create function from the api to create a node.

It seems to be a common jquery problem that I am facing. Please let me know what is getting wrong.

Fiddle here - http://jsfiddle.net/juyMR/16/

Ashwin
  • 12,081
  • 22
  • 83
  • 117

1 Answers1

0

Changing the line to:

$("#jsTreeDiv").jstree("create_node",$('#linodeid1'),false,"new name",false,false);

This will add to the root:

function createNode() {
    $("#jsTreeDiv").jstree("create_node",$('#jsTreeDiv'),false,{ state: "leaf", data: "No rename!" },false,true);
}

You have to identify the parent of the node you want to add the new node too.

boz
  • 4,891
  • 5
  • 41
  • 68
DRobertE
  • 3,478
  • 3
  • 26
  • 43