search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to collapse all groups by default ?

Asked by Ramgaard
1 year ago.

Hello,

Is it somehow possible to have all groups collapsed by default ?

I'm aware that I can use: DayPilot.Row.groups.collapseAll(); after gantt is loaded, but I want them to be collapsed as default.

Thanks

Answer posted by Dan Letecky [DayPilot]
1 year ago.

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:

{
  id: 1
  start: "2019-01-01T09:00:00",
  end: "2019-01-01T13:00:00",
  text: "Task 1",
  row: {
    collapsed: true
  },
  children: [ ... ]
}

See also:
https://api.daypilot.org/daypilot-task-data/

The DayPilot.Row.groups.collapseAll() method doesn't control the tree node expanded/collapsed state but "concurrent event groups" in the Scheduler:
https://doc.daypilot.org/scheduler/concurrent-event-groups/

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.