DayPilot.Scheduler.getCoords

The getCoords() method returns information about the current mouse cursor position (relative to the Scheduler grid).

Available since 2019.2.3817.

Syntax

DayPilot.Scheduler.getCoords();

Return Value

An object with the following properties:

  • x (number) - horizontal position in pixels

  • y (number) - vertical position in pixels

  • grid (string) - grid name, indicates the main grid or frozen rows ("main" | "top" | "bottom")

  • time (DayPilot.Date object) - current position in the timeline

  • row (DayPilot.Row object) - current row

  • cell - current grid cell

  • event (DayPilot.Event object) - if the mouse cursor is on an event, it holds the event object

  • eventOffset (object with x, y properties) - if the mouse cursor is on an event, it holds the relative coords in pixels

It returns null if the current position cannot be read (e.g. mouse is outside of the grid).