DayPilot.Scheduler.keyboard.getFocus

The keyboard.getFocus() method returns the current keyboard focus of the JavaScript Scheduler.

Available since 2021.3.5074.

Declaration

DayPilot.Scheduler.keyboard.getFocus();

Return Value

Returns an object with the following properties:

  • e (DayPilot.Event) - focused event when the current focus target is an event; otherwise null

  • cell - focused cell when the current focus target is a cell; otherwise null

The cell object includes these properties:

If the keyboard focus is not active, the method returns null.

Notes

The returned focus object uses the same structure as args.focus and args.previous in DayPilot.Scheduler.onKeyboardFocusChange and DayPilot.Scheduler.onKeyboardFocusChanged.

Example

const focus = dp.keyboard.getFocus();
if (focus && focus.cell) {
  console.log(focus.cell.start, focus.cell.resource);
}

See Also

DayPilot.Scheduler.keyboard.clearFocus()

DayPilot.Scheduler.keyboard.focusCell()

DayPilot.Scheduler.keyboard.focusEvent()

Keyboard Support [doc.daypilot.org]

DayPilot.Scheduler.onKeyboardFocusChange

DayPilot.Scheduler.onKeyboardFocusChanged

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript