Premium support for our pure JavaScript UI components


Post by Phil234234234234 »

Hello

I recently noticed a problem with our Calendar dragging on Salesforce on Calendar version 4.3.9. Essentially when you first load in the component and some data (For me it was one resource and one event) - if you try and drag that event back one or two days, the GUI does not accept that change- but rather 'bounces back' the event to where it originally was. I've attached a very quick video highlighting this. The bug can only be replicated if you drag the event back, not forwards.

This only seems to happen when you are using a custom model for the calendar event store, and applying that model on calendar start and end date fields.

We have a function

export function createPlaybookCalendarEventModelClass() {}`

which returns class

PlaybookCalendarEventModel extends getClass('Scheduler.model.EventModel')

. Inside this returned class, we have a getter for a fields value - which returns a array of fields. In the example in the video, I had two fields -

	{ name: 'startDate', dataSource: 'catStartDate' },
	{ name: 'endDate', dataSource: 'catEndDate' },

I then applied the new model class with

 this.calendar.eventStore.modelClass = this.modelClass; 

.

I then loaded in the event to the event store

eventStore.add({
		id: 'eventId1',
		name: 'event1',
		resourceId: 'id1',
		catStartDate: new Date(2022, 4, 16),
		catEndDate: new Date(2022, 4, 18),
		allDay: true
	});

As you could see in the video, applying the model fields to the date fields seemed to work. It was only when dragging the event backwards that we started to get strange behaviour. I attempted to replicate this in a Bryntum demo - but I wasn't sure how to import a Model to extend and create a new class from.

Has anyone else seen this before? Is it possible for this to get looked at? Thanks!

Attachments
Screen Recording 2022-05-17 at 08.53.37.mov
(4.71 MiB) Downloaded 41 times

Post by alex.l »

Thank you for the report.
https://bryntum.com/docs/calendar/api/Scheduler/data/EventStore#config-modelClass is a config, it means it cannot be set at runtime, so please apply modelClass before initialization:

   crudManager : {
        transport : {
            load : {
                url : 'data/data.json'
            }
        },
        eventStore : {
            modelClass : ModelClassName
        },
        autoLoad : true
    },

I reproduced the bug with vanilla example, here is a ticket https://github.com/bryntum/support/issues/4631

All the best,
Alex


Post by bkohler »

Hi, is there any update on this issue? It has been open for quite some time now.

Thanks,
Beth


Post by mats »

We'll try to check this soon!


Post Reply