You probably mean the Gantt chart which displays the nodes expanded by default.
You can override the default value using row.collapsed property of the data object:
text: "Task 1",
children: [ ... ]
The DayPilot.Row.groups.collapseAll() method doesn't control the tree node expanded/collapsed state but "concurrent event groups" in the Scheduler: