Expand / Collpase

Initial collaps

Initially you can collapse the ids you don't want to show by setting the array or pushing to the array of collapsed nodes:

     
familyTree.collapsedIds = [8, 9, 12, 13];
familyTree.collapsedIds.push(11);
 
Code example:

Load on expand

You can load on demand nodes by clicking on expand/collapse button to show the hidden nodes:

     
familyTree.onDemand(function(args){
    familyTree.addFamilyMembers([{id: args.ids[0], name: 'loaded on demand'}]).draw()
});
 
Code example:

Here you can see how to customize the Expand / Collapse buttons