Our powerful JS Calendar component


Post by tokytok »

Hi,

I need to check if the drag move is allow by comparing old start date and new start date.
https://www.bryntum.com/docs/calendar/#Calendar/feature/CalendarDrag#config-validateMoveFn

With the 4.0.3, I could have the oldEventRecord like this :

validateMoveFn: ({ event, eventRecord, drag }) => {
    ...
    const oldEventRecord = drag.data.find(i => i.type === 'event');
    ...
}

With the 4.0.5, this is not working.
Can you help me please ?
Thanks


Post by pmiklashevich »

Hello,

DragContext is private. But the docs of validateMoveFn mention get function to get the context data. You can try the code below:

    features : {
        drag : {
            async validateMoveFn({ drag }) {
                const record = await drag.get('eventRecord');
                console.log(record.startDate);
            }
        },

We will consider to make it public: https://github.com/bryntum/support/issues/2181

Best,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply