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 pixelsy(number) - vertical position in pixelsgrid(string) - grid name that indicates the main grid or frozen rows ("main"|"top"|"bottom"); available in DayPilot Protime(DayPilot.Date object) - current position in the timelinerow(DayPilot.Row object) - current rowcell(object) - current grid cell; available in DayPilot Proevent(DayPilot.Event object) - if the mouse cursor is on an event, it holds the event object; available in DayPilot ProeventOffset(object withx,yproperties) - if the mouse cursor is on an event, it holds the relative coordinates in pixels; available in DayPilot Proalt(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]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot