Search code examples
jqtree

Append child before a particuler child in jqtree


I am using jqTree in our project http://mbraak.github.io/jqTree/

I have tree structure like this

-A
 -B
 -C
  -C1
  -C2
 -D

I want to add new child E to A in 2nd position like this

-A
 -B
 -E
 -C
  -C1
  -C2
 -D

How can I do this???


Solution

  • You can use the addNodeAfter function.

    See http://mbraak.github.io/jqTree/#functions-addnodeafter