The focus property (string) specifies the id of the form field that should be focused when a modal dialog displayed using DayPilot.Modal.form() opens.
Declaration
DayPilot.Modal.focusDefault Value
nullNotes
The specified field is focused only when autoFocus is set to true.
Example
const form = [
{name: "Start", id: "start", type: "date"},
{name: "End", id: "end", type: "date"},
{name: "Text", id: "text"},
];
const data = {
text: "Event 1",
start: "2025-11-01",
end: "2025-11-02",
};
const options = {
focus: "text"
};
const modal = await DayPilot.Modal.form(form, data, options);See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot