Schedule: Is it possible to show appointments for both resource rows and resource group rows at the same time?

Hello,

we're using the schedule element for our current project.
In terms of logic, we do have project leaders and projects. A project leader can have many projects, while a project always can only have one project leader.

So far I am able to show the projects as resources and the project leaders as resource group parents.

I want to show different appointments both on project and project leader layer and wondered if this is possible.

Please have a look at the following image. 


Screenshot 2022-05-03 113803.png


This is my code, where I define my appointments...

// Resources Main Definition
  public group: GroupModel = {
    resources: ['Projektleiters', 'Projekte']
  };

  // Parent Resource Definition
  public projektleiterDataSource: Record<string, any>[] = [
    { text: 'Projektleiter 1', id: 1, color: '#cb6bb2' },
    { text: 'Projektleiter 2', id: 2, color: '#56ca85' },
  ];

  // Child Resource Definition
  public projektDataSource: Record<string, any>[] = [
    { text: 'Projekt 1', id: 4, color: '#df5286', groupId: 1 },
    { text: 'Projekt 2', id: 5, color: '#7fa900', groupId: 1 },
    { text: 'Projekt 3', id: 6, color: '#ea7a57', groupId: 2 },
    { text: 'Projekt 4', id: 7, color: '#5978ee', groupId: 2 },
  ];



  myData: Object[] = [
    {
      Id: 1,
      Subject: 'Projektphase 1',
      // Description: 'Meeting to discuss business goal of 2018.',
      StartTime: new Date(2022, 4, 5, 0, 0),
      EndTime: new Date(2022, 4, 20, 0, 0),
      ProjektId: 4
    },
    {
      Id: 2,
      Subject: 'Projektleiterphase 1',
      // Description: 'Meeting to discuss business goal of 2018.',
      StartTime: new Date(2022, 4, 5, 0, 0),
      EndTime: new Date(2022, 4, 20, 0, 0),
      ProjektleiterId: 1
    },
    {
      Id: 3,
      Subject: 'Projektleiterphase 2',
      // Description: 'Knowledge sharing on JSP topics.',
      StartTime: new Date(2022, 4, 5, 0, 0),
      EndTime: new Date(2022, 4, 20, 0, 0),
      ProjektleiterId: 2
    },
    {
      Id: 4,
      Subject: 'Projektphase 2',
      // Description: 'Planning tasks for sprint.',
      StartTime: new Date(2022, 4, 5, 0, 0),
      EndTime: new Date(2022, 4, 20, 0, 0),
      ProjektId: 5
    },
  ]


It seems like the appointments on project-layer are not being shown, tough I have defined them in my code.


Thank you in advance.


Greetings,

Julian


3 Replies 1 reply marked as answer

RM Ruksar Moosa Sait Syncfusion Team May 4, 2022 01:43 PM UTC

Hi Julian,


We have prepared a sample to render appointments on the parent and the child resources. To render an appointment in the child row, you need to define both parent & child id like the below code.


export
let
timelineResourceDataRecord<stringany>[] = [

  {

    Id:
1,

    Subject:
'Projektphase 1',

    // Description: 'Meeting to discuss business goal of 2018.',

    StartTime:
new
Date(20224500),

    EndTime:
new
Date(202242000),

    ProjektleiterId:
1,

    ProjekteId:
4

  }, {

    Id:
2,

    Subject:
'Projektleiterphase 1',

    // Description: 'Meeting to discuss business goal of 2018.',

    StartTime:
new
Date(20224500),

    EndTime:
new
Date(202242000),

    ProjektleiterId:
1,

  }, {

    Id:
3,

    Subject:
'Projektleiterphase 2',

    // Description: 'Knowledge sharing on JSP topics.',

    StartTime:
new
Date(20224500),

    EndTime:
new
Date(202242000),

    ProjektleiterId:
2,

  }, {

    Id:
4,

    Subject:
'Projektphase 2',

    // Description: 'Planning tasks for sprint.',

    StartTime:
new
Date(20224500),

    EndTime:
new
Date(202242000),

    ProjektleiterId:
2,

    ProjekteId:
7

  }

];


Sample: https://stackblitz.com/edit/angular-hgxora?file=app.component.ts


Output:


A picture containing graphical user interface

Description automatically generated


Kindly try the above sample and let us know if this meets your requirement.


Regards,

Ruksar Moosa Sait


Marked as answer

JW Julian Wandel replied to Ruksar Moosa Sait May 5, 2022 06:24 AM UTC

Hi Ruksar,


thank you very much for your answer.


It's working now, but if I click a cell on the parent resource row, the create appointment dialog doesn't appear.
Is there a way to get this working?

Thanks in advance.


Regards,

Julian



RM Ruksar Moosa Sait Syncfusion Team May 6, 2022 12:15 PM UTC

Hi Julian,


Thanks for the update.


It is not possible to create or edit an appointment at the Parent level of the resources as it is our default behavior. Let us know If you need further assistance.


Regards,

Ruksar Moosa Sait


Loader.
Up arrow icon