jquery.orgChart icon indicating copy to clipboard operation
jquery.orgChart copied to clipboard

Issue in deleting Child Nodes

Open SainathBommisetty opened this issue 9 years ago • 0 comments

//Old Code /*this.deleteNode = function(id){ for(var i=0;i<nodes[id].children.length;i++){ self.deleteNode(nodes[id].children[i].data.id); } nodes[nodes[id].data.parent].removeChild(id); delete nodes[id]; self.draw(); }

//Working Code this.deleteNode = function(id){ while(nodes[id].children.length){ self.deleteNode(nodes[id].children[nodes[id].children.length-1].data.id); } nodes[nodes[id].data.parent].removeChild(id); delete nodes[id]; self.draw(); }

SainathBommisetty avatar Feb 22 '16 06:02 SainathBommisetty