Our pure JavaScript Scheduler component


Post by richard.schoeffauer »

Hello Bryntum Team,

i am implementing the resize functionality for our events. Depending on which event-handle (left or right) the resizing is initiated with, different things should happen. However, i can not find a proper way to detect which handle is used for the resizing.

My work around so far is to check the "event.offsetX" (of the browser event, e.g. in the onBeforeEventResize) which gives me difference in pixels between the left edge of the actually rendered event and whereever my mouse position was when resize was initiated.

However, this workaround isn't really reliable regarding resolution and zoom changes.
Is there a proper way to detect, which handle the resizing was initiated with?


Post by marcio »

Hey richard,

Thanks for reaching out.

Currently, the way that you're using (calculating with offset) would be the indicated way. But I created a ticket to provide that info in the event data https://github.com/bryntum/support/issues/9810.

Best regards,
Márcio


Post by richard.schoeffauer »

Obrigado for the quick reply,

while the ticket is in progress, i guess using "event.target.offsetWidth" for the total width of the event and then calculating the distance to the middle of the rendered object makes this approach robust enough.


Post Reply