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") [Pro only]

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

  • row (DayPilot.Row object) - current row

  • cell - current grid cell [Pro only]

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

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

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