DayPilot.Calendar.onEventResize

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 resized

  • args.newStart (DayPilot.Date) - new event start

  • args.newEnd (DayPilot.Date) - new event end

  • args.async (boolean) - set to true to handle the resize asynchronously

  • args.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

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript

Lite args missing: async, hideShadow, loaded