Our pure JavaScript Scheduler component


Post by gregc »

I am staring at the these two configurations https://www.bryntum.com/examples/scheduler/recurrence/ and https://www.bryntum.com/examples/scheduler/columns

one has multi resource selection per event, the second has a single resource per event.
But I can't see what in the config makes one multi or one not multi?

Last edited by gregc on Sat Feb 27, 2021 7:17 pm, edited 1 time in total.

Post by mats »

It's defined in the data. Multi-assign mode is when you use an assignmentStore. If you skip assignments and just set a resourceId, we assume single-assignment mode.

resources = [{
            id: 'r1',
            name: 'Celia',
            city: 'Barcelona'
        },
        {
            id: 'r2',
            name: 'Lee',
            city: 'London'
        },
        {
            id: 'r3',
            name: 'Macy',
            city: 'New York'
        },
        {
            id: 'r4',
            name: 'Madison',
            city: 'Barcelona'
        },
        {
            id: 'r5',
            name: 'Rob',
            city: 'Rome'
        },
        {
            id: 'r6',
            name: 'Dave',
            city: 'Barcelona'
        },
        {
            id: 'r7',
            name: 'Dan',
            city: 'London'
        },
        {
            id: 'r8',
            name: 'George',
            city: 'New York'
        },
        {
            id: 'r9',
            name: 'Gloria',
            city: 'Rome'
        },
        {
            id: 'r10',
            name: 'Henrik',
            city: 'London'
        }
    ],
    events = [{
            id: 1,
            startDate: new Date(2017, 0, 1, 10),
            endDate: new Date(2017, 0, 1, 12),
            name: 'Multi assigned',
            iconCls: 'b-fa b-fa-users'
        },
        {
            id: 2,
            startDate: new Date(2017, 0, 1, 13),
            endDate: new Date(2017, 0, 1, 15),
            name: 'Single assigned',
            iconCls: 'b-fa b-fa-user',
            eventColor: 'indigo'
        },
        {
            id: 3,
            startDate: new Date(2017, 0, 1, 8),
            endDate: new Date(2017, 0, 1, 11),
            name: 'Single assigned',
            iconCls: 'b-fa b-fa-user',
            eventColor: 'cyan'
        },
        {
            id: 4,
            startDate: new Date(2017, 0, 1, 10),
            endDate: new Date(2017, 0, 1, 13),
            name: 'Single assigned',
            iconCls: 'b-fa b-fa-user',
            eventColor: 'blue'
        },
        {
            id: 5,
            startDate: new Date(2017, 0, 1, 13),
            endDate: new Date(2017, 0, 1, 15),
            name: 'Single assigned',
            iconCls: 'b-fa b-fa-user',
            eventColor: 'violet'
        }
    ],
    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
        }
    ];

Post by gregc »

Ah I was wondering why there was a resource in events when I had assignments, got it, thanks!


Post by outputlogic »

if I create the event programatically the Id of the event is not available so adding an assignment to the store is not possible until the event is sync or is there any other way to add an event and assignment programatically one after the other?


Post by mats »

@outputlogic: Please start a new thread and provide details of your issue


Post Reply