The confirm() method displays a pre-configured modal dialog with custom HTML content and OK and Cancel buttons.
Declaration
DayPilot.Modal.confirm(message[, options])Parameters
message(string) - HTML messageoptions(object) - an object that specifies custom DayPilot.Modal properties
Return Value
Returns a Promise. The promise resolves when the modal dialog is closed using either button or by clicking the background, and it receives the args object from DayPilot.Modal.onClosed. The promise never rejects.
Notes
In addition to the standard DayPilot.Modal properties, the options object can define custom button text using options.okText and options.cancelText.
By default, the pre-configured dialog uses DayPilot.Modal.height = 40 and DayPilot.Modal.useIframe = false.
Example
const modal = await DayPilot.Modal.confirm("Delete this item?", {
okText: "Delete",
cancelText: "Keep"
});
console.log("Dialog closed", modal.result);See Also
JavaScript confirm() Replacement [code.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot