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

Available since 2019.2.3817.

Declaration

DayPilot.Scheduler.getCoords()

Return Value

Returns an object with the following properties:

  • x (number) - horizontal position in pixels

  • y (number) - vertical position in pixels

  • grid (string) - grid name that indicates the main grid or frozen rows ("main" | "top" | "bottom"); available in DayPilot Pro

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

  • row (DayPilot.Row object) - current row

  • cell (object) - current grid cell; available in DayPilot Pro

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

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

  • alt (boolean) - Alt key pressed status (since 2026.2.6911)

  • ctrl (boolean) - Ctrl key pressed status (since 2026.2.6911)

  • shift (boolean) - Shift key pressed status (since 2026.2.6911)

  • meta (boolean) - Meta key pressed status (since 2026.2.6911)

Returns null if the current position cannot be read, for example when the mouse cursor is outside of the grid.

Example

const dp = new DayPilot.Scheduler("dp", {
  // ...
});
dp.init();

const coords = dp.getCoords();

See Also

Frozen Rows [doc.daypilot.org]

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

ProductLitePro
DayPilot for JavaScript