Our powerful JS Calendar component


Post by tripti.v »

Hi,

I am trying to create my own event when an external-event is dropped from the external grid source and trying to avoid the default event from being created before the drop itself.

Below is the example I have based upon for this functionality.
https://codepen.io/Animal-Nige/pen/ByaWLRa?editors=0010

I am looking for adding onBeforeDragCreateEnd event with my own custom popup to be created instead of the default event.

Not sure if I am looking at the wrong trigger event or placed it wrong, but I have tried it as per the screenshot below and it doesn't seem to be triggered. Could you please help. Thanks in advance!

Attachments
onBeforeDragMoveEndEvent.png
onBeforeDragMoveEndEvent.png (70.95 KiB) Viewed 1341 times

Post by Animal »

It is not doing a drag-create.

A drag create is a mousedown in a Calendar view followed by a drag inside that view.

It is a drag from external.

There is a documented event to intervene before the gesture is actioned: https://bryntum.com/products/calendar/docs/api/Calendar/feature/ExternalEventSource#event-beforeDropExternal

And it is illustrated in an example: https://bryntum.com/products/calendar/examples/dragfromgrid/


Post by tripti.v »

Thank you for that. I am using the OnDropExternal method and I am unable to get the startDate of where the event is dropped. It currently shows null on the eventRecord, as shown in the screenshot. is there a way I can get the startDate based on the date that external event is dropped on please?

Attachments
onDropExternalCall.png
onDropExternalCall.png (31.06 KiB) Viewed 1187 times
startDateNull.png
startDateNull.png (14.67 KiB) Viewed 1187 times

Post by tripti.v »

I have managed to get the startDate from DomEvent, as shown in the screenshot below.
But I am not able to remove the default event created. tried eventRecord.remove() but unable to prevent the default event from being created from OnDragExternal. Could you please help with that, Thank you!

Attachments
getDateFromDomEvent.png
getDateFromDomEvent.png (37.28 KiB) Viewed 1185 times
removeRecord.png
removeRecord.png (38.05 KiB) Viewed 1185 times

Post by tasnim »

From where you want to remove, which event? It would be great if you could show us in a video or by annotating a screenshot.

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post Reply