$dailog
Updated on Aug 22, 2025 5 minutes to readThe Dialog Plugin provides a unified interface to show alerts, confirmations, questions, and other dialog types. It supports customizable messages, titles, spinners, and date range selection.
Methods
| Method | Description |
|---|---|
| alert | Shows an alert dialog with optional title. |
| close | Closes the currently open dialog. |
| confirm | Shows a confirmation dialog with optional title. |
| danger | Shows a danger-style dialog with optional title. |
| info | Shows an informational dialog with optional title. |
| question | Shows a question dialog with optional title. |
| selectDateRange | Opens a date range picker dialog. |
| spinner | Displays a spinner dialog. |
| success | Shows a success-style dialog with optional title. |
| warning | Shows a warning-style dialog with optional title. |
Methods Details
alert()
• Type
(text?: string, title?: string) => Promise<DialogResult>
• Details
Expects optional text and title strings (can contain html code) to display in the alert dialog.
Returns a Promise that resolves with a DialogResult.
• Example
E8App.$dialog.alert('<div class="text-success">Hello</div>', 'Greeting')
close()
• Type
() => void
• Details
Closes the currently open dialog.
confirm()
• Type
(text?: string, title?: string) => Promise<DialogResult>
• Details
Expects optional text and title strings (can contain html code) to display in the confirmation dialog.
Returns a Promise that resolves with a DialogResult.
• Example
E8App.$dialog.confirm('Press a button', 'Confirm');
danger()
• Type
(text?: string, title?: string) => Promise<DialogResult>
• Details
Expects optional text and title strings (can contain html code) to display in the danger-style dialog.
Returns a Promise that resolves with a DialogResult.
• Example
E8App.$dialog.danger('Danger!', “It’s a danger dialog”);
info()
• Type
(text?: string, title?: string) => Promise<DialogResult>
• Details
Expects optional text and title strings (can contain html code) to display in the informational dialog.
Returns a Promise that resolves with a DialogResult.
• Example
E8App.$dialog.info('Info message');
question()
• Type
(text?: string, title?: string) => Promise<DialogResult>
• Details
Expects optional text and title strings (can contain html code) to display in the question dialog.
Returns a Promise that resolves with a DialogResult.
• Example
E8App.$dialog.question('Are you sure you want to save changes?', 'Question');
selectDateRange()
• Type
(options?: SelectDateRangeOptions) => Promise<SelectDateRangeResult>
• Details
Expects optional SelectDateRangeOptions including startDate and endDate.
If startDate is after endDate, the method swaps them.
Returns a Promise that resolves with a SelectDateRangeResult.
• Example
E8App.$dialog.selectDateRange({
startDate: E8App.$date.addWeeks(E8App.$date.current(), -7),
endDate: E8App.$date.current()
})
.then((res) => console.log(res))
.catch(() => {
console.log('cancel')
});
spinner()
• Type
() => void
• Details
Displays a spinner dialog.
success()
• Type
(text?: string, title?: string) => Promise<DialogResult>
• Details
Expects optional text and title strings (can contain html code) to display in the success-style dialog.
Returns a Promise that resolves with a DialogResult.
• Example
E8App.$dialog.success('Changes have been saved', 'Success');
warning()
• Type
(text?: string, title?: string) => Promise<DialogResult>
• Details
Expects optional text and title strings (can contain html code) to display in the warning-style dialog.
Returns a Promise that resolves with a DialogResult.
• Example
E8App.$dialog.warning('The application cannot be installed', 'Warning');