The onEventResize event handler fires when an event is being resized, before the default resize action is performed.
Declaration
DayPilot.Calendar.onEventResize(args)
Parameters
args.e(DayPilot.Event) - the event being resizedargs.newStart(DayPilot.Date) - new event startargs.newEnd(DayPilot.Date) - new event endargs.async(boolean) - set totrueto handle the resize asynchronouslyargs.preventDefault()- cancels the default resize action
Notes
In api=1 mode, this event is called only if eventResizeHandling is set to "JavaScript".
Examples
JavaScript
const calendar = new DayPilot.Calendar("dp", {
onEventResize: args => {
if (args.e.id() === "3") {
args.preventDefault();
DayPilot.Modal.alert("Event 3 cannot be resized.");
}
},
// ...
});
calendar.init();
Angular
<daypilot-calendar [config]="config"></daypilot-calendar>
config: DayPilot.CalendarConfig = {
onEventResize: args => {
if (args.e.id() === "3") {
args.preventDefault();
DayPilot.Modal.alert("Event 3 cannot be resized.");
}
},
// ...
};
React
<DayPilotCalendar
onEventResize={args => {
if (args.e.id() === "3") {
args.preventDefault();
DayPilot.Modal.alert("Event 3 cannot be resized.");
}
}}
{/* ... */}
/>
Vue
<DayPilotCalendar @eventResize="onEventResize" <!-- ... --> />
const onEventResize = args => {
if (args.e.id() === "3") {
args.preventDefault();
DayPilot.Modal.alert("Event 3 cannot be resized.");
}
};See Also
Event Resizing [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
Lite args missing: async, hideShadow, loaded
DayPilot