Our pure JavaScript Scheduler component


Post by karg »

Hi all,

This is a question that applies to Scheduler and also the Calendar. I have event/ task data that has two kinds of data: who is assigned to the task and location of the task (which is optional). To throw in another curveball, the task can be assigned to more than one user.

How should I approach this? Is there anything in existing API/ example that I should refer to?

Many thanks!
Karg


Post by mats »

Please see our multiassignment demo, should be what you're looking for: https://bryntum.com/examples/scheduler/multiassign/


Post by karg »

Thanks, i saw the example. Regarding this part of the code in the example:

assignments = [
        { id : 1, resourceId : 'r1', eventId : 1 },
        { id : 2, resourceId : 'r2', eventId : 1 },
        { id : 3, resourceId : 'r8', eventId : 1 },
        { id : 4, resourceId : 'r3', eventId : 2 },
        { id : 5, resourceId : 'r4', eventId : 3 },
        { id : 6, resourceId : 'r5', eventId : 4 },
        { id : 7, resourceId : 'r6', eventId : 5 }
    ];

I checked the documentation at https://bryntum.com/docs/calendar/#Calendar/view/Calendar,
does it work if i just pass in the assignments array to the Calendar constructor?


Post by mats »

No, the Calendar accepts only 'events' and 'resources':

events : [
        {
            id        : 1,
            name      : 'foo',
            startDate : new Date(2020, 9, 11),
            duration  : 1
        }
    ],

Post Reply