DayPilot.Gantt.getCoords

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

Available since 2023.3.5734.

Syntax

DayPilot.Gantt.getCoords();

Return Value

An object with the following properties:

  • x (number) - horizontal position in pixels

  • y (number) - vertical position in pixels

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

  • cell - current grid cell

  • task (DayPilot.Task object) - current row

  • taskOffset (object with x, y properties) - if the mouse cursor is on a task box, 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).