fancytree icon indicating copy to clipboard operation
fancytree copied to clipboard

BUG: error while adding nodes to empty tree

Open Koloto opened this issue 13 years ago • 1 comments

Steps to reproduce:

  1. Call removeChildren() for the root node
  2. Call addChildren(...) for the root node It throws an error: TypeError: Cannot call method 'appendChild' of null

jsFiddle: http://jsfiddle.net/VeqaH/7/

Koloto avatar Oct 01 '13 10:10 Koloto

Can be fixed by replacing

node.li.appendChild(node.ul); //near 2403 in jquery.fancytree.js

with

if (node.li != null) {
    node.li.appendChild(node.ul);
} else {
    node.tree.$div.append(node.ul);
} 

flcl42 avatar Dec 22 '13 12:12 flcl42