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

Scheduler for Angular2 not creating resource children

Asked by Anonymous
2 years ago.

Hello,

I am using the angular2 component of the scheduler and I am trying to display children for resource rows.
The configuration looks something like this:
config: any = {
scale: 'Hour',
cellWidth: 50,
resources: [
{ name: "Room A", id: "A", expanded: true, children:[
{ name : "Room A.1", id : "A.1" },
{ name : "Room A.2", id : "A.2" }
]
},
{ name: "Room B", id: "B" }
],
width: '100%',
startDate: '2017-01-01',
days: 2
};

But only 'Room A' and 'Room B' is displayed but not the children of 'Room A'. Any ideas why this happens?

Answer posted by Dan Letecky [DayPilot]
2 years ago.

The resource tree is disabled by default (it adds node icons to the rows which is not desired if it's a flat structure). You can enable by adding "treeEnabled: true":

  config: any = {
    scale: 'Hour',
    cellWidth: 50,
    treeEnabled: true,
    resources: [
      { name: "Room A", id: "A", expanded: true, children:[
        { name : "Room A.1", id : "A.1" },
        { name : "Room A.2", id : "A.2" }
       ]
      },
      { name: "Room B", id: "B" }
    ],
    width: '100%',
    startDate: '2017-01-01',
    days: 2
  };

See also:
https://doc.daypilot.org/scheduler/resource-tree/

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