DayPilot.Calendar.onEventResizing

The onEventResizing event is fired by the JavaScript Calendar component during event resizing, on every change of the target position. You can use it to control the resizing shadow appearance and implement custom business rules. See also event resizing customization.

Declaration

DayPilot.Calendar.onEventResizing(args)

Parameters

  • args.e (DayPilot.Event object) - the event being resized [read-only]

  • args.start (DayPilot.Date) - start of the target position; since 2024.2.5922 the value can be modified

  • args.end (DayPilot.Date)  - end of the target position; since 2024.2.5922 the value can be modified

  • args.resource (string | number) - current resource id [read-only]

  • args.html (string) - HTML content of the target shadow

  • args.cssClass (string) - CSS class to be applied to the target shadow

  • args.allowed (boolean) - enabled/disable drop at this position

  • args.anchor (DayPilot.Date) - the edge that is not being resized (available since 2023.4.5770)

  • args.top.width (number) - width of the “top” label, use null for auto width

  • args.top.space (number) - distance of the “top” label from the shadow in pixels

  • args.top.html (string) - HTML of the “top” label

  • args.top.enabled (boolean) - enable/disable the “top” label

  • args.bottom.width (number) - width of the “bottom” label, use null for auto width

  • args.bottom.space (number) - distance of the “bottom” label from the shadow in pixels

  • args.bottom.html (string) - HTML of the “bottom” label

  • args.bottom.enabled (boolean) - enable/disable the “bottom” label

Example

{
  onEventResizing: (args) => {
    args.top.enabled = true;
    args.top.html = "Duration: " + new DayPilot.Duration(args.start, args.end).totalHours() + " hours";
  }
  // ...
}