Premium support for our pure JavaScript UI components


Post by jamesb »

Hello,

When I drop an event on the first resource of the scheduler, the event plays a "bouncing" animation, and the event context menu fails to open on right click.

The issue cannot be reproduced when dropping an event on other resources than the first one.

populateEventMenu.png
populateEventMenu.png (132.44 KiB) Viewed 223 times
populateEventMenu_video.mp4
(646.11 KiB) Downloaded 19 times

The attached video demonstrates that:

  • Drag&drop of event 1 onto resource B -> working context menu on event 1
    Drag&drop of event 2 onto resource A -> populateEventMenu fails on event 2

I reproduced this issue on the inline data demo, using the following code and data:

import { SchedulerPro } from '../../build/schedulerpro.module.js?465031';
import shared from '../_shared/shared.module.js?465031';
export const data = {
    "eventsData": [
        {
            "id": 1,
            "name": "1",
            "startDate": "2022-10-02T09:12:00",
            "endDate": "2022-10-02T12:48:00",
        }, 
        {
            "id": 2,
            "name": "2",
            "startDate": "2022-10-02T09:48:00",
            "endDate": "2022-10-02T16:24:00",
        }
    ],
    "resourcesData": [
        {
            "id": 0,
            "name": "A",
            "image": false
        },
        {
            "id": 1,
            "name": "B",
            "image": false
        }
    ],
    "assignmentsData": [
        {
            "id": 0,
            "resourceId": 0,
            "eventId": 1
        },
        {
            "id": 1,
            "resourceId": 1,
            "eventId": 2
        }
    ],

};

const
    schedulerPro = new SchedulerPro({
        appendTo   : 'container',
        startDate  : '2022-10-02',
        endDate    : '2022-10-02',
        viewPreset : 'hourAndDay',
        forceFit   : true,
        columns    : [
            {
                type           : 'resourceInfo',
                text           : 'Name',
                field          : 'name',
                showEventCount : true,
                width          : 150
            }
        ],
        resources    : data.resourcesData,
        events       : data.eventsData,
        assignments  : data.assignmentsData,
        dependencies : data.dependenciesData
    });

I tried disabling the event menu to workaround this error, without success.
Is there an error in my data or scheduler configuration?


Post by marcio »

Hey jamesb,

That's caused because of that id: 0 that you have in the resourcesData and assignmentsData, setting like this makes the error disappears:

export const data = {
    eventsData : [
        {
            id        : 1,
            name      : '1',
            startDate : '2022-10-02T09:12:00',
            endDate   : '2022-10-02T12:48:00'
        },
        {
            id        : 2,
            name      : '2',
            startDate : '2022-10-02T09:48:00',
            endDate   : '2022-10-02T16:24:00'
        }
    ],
    resourcesData : [
        {
            id    : 1,
            name  : 'A',
            image : false
        },
        {
            id    : 2,
            name  : 'B',
            image : false
        }
    ],
    assignmentsData : [
        {
            id         : 1,
            resourceId : 1,
            eventId    : 1
        },
        {
            id         : 2,
            resourceId : 2,
            eventId    : 2
        }
    ]

};

Best regards,
Márcio


Post by jamesb »

Hi Márcio,

Thank you for your answer!
I just came to the same conclusion playing a bit more with the example, however I couldn't find in the documentation anything about "id: 0" being an invalid ID. Could you point me to the relevant documentation page?

As the Scheduler correctly loads the initial data, it feels like "id: 0" is supported at least partially, but not on data update. Is it a correct assumption?

Last edited by jamesb on Mon Jan 23, 2023 4:16 pm, edited 1 time in total.

Post by marcio »

Hey jamesb,

Actually, the use of an id different from 0 it's a workaround, it's a bug that is not working correctly, so I created a ticket to fix that https://github.com/bryntum/support/issues/6025

Best regards,
Márcio


Post by jamesb »

Sounds good, thank you Márcio.


Post Reply