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; otherwisenullcell- focused cell when the current focus target is a cell; otherwisenull
The cell object includes these properties:
start(DayPilot.Date) - cell startend(DayPilot.Date) - cell endresource(string) - resource ID
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
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot