Skip to content

collapsedGroups

The groups (by their resourceGroupField value) a timeline shows shut.

Typereadonly string[]
Default[]
Live update (update())Yes
Declared inpackages/core/src/kernel.ts

With resourceGroupField, the Pro’s timeline (import '@dzcalendar/pro') draws a row per group above its resources, with a button that shuts and opens it. collapsedGroups names the shut ones by the field’s value ('Imaging'); like collapsedResources, it is the calendar’s state, kept across update() and reported by onResourceToggle.

import { createCalendar } from '@dzcalendar/dom';
import '@dzcalendar/pro';
const calendar = createCalendar(element, {
timeZone: 'Europe/Paris',
initialView: 'resourceTimelineDay',
resources: [
{ id: 'benali', title: 'Dr Benali', service: 'Cardiology' },
{ id: 'room1', title: 'Room 1', service: 'Imaging' },
],
resourceGroupField: 'service',
collapsedGroups: ['Imaging'],
});
// Later: every group open.
calendar.update({ collapsedGroups: [] });

In Angular and Vue it goes in options; in React it is a prop.

The Imaging group shut, Cardiology open.