DayPilot.Modal.focus

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.focus

Default Value

null

Notes

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

DayPilot.Modal.autofocus

DayPilot.Modal.form()

DayPilot.Modal Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript