eLabSDK2.UI.Dialog
Hierarchy
-
default↳
Dialog
Methods
closeDialog
Static closeDialog(data?): Promise<any>
Close the currently open dialog.
Parameters
| Name | Type | Description |
|---|---|---|
data? | unknown | Data to pass back when closing the dialog |
Returns
Promise<any>
A promise that resolves when the dialog is closed
confirm
Static confirm(title, contents, subTitle?): Promise<unknown>
Display a confirmation dialog with OK and Cancel buttons.
Parameters
| Name | Type | Description |
|---|---|---|
title | string | The dialog title |
contents | string | The dialog content/message |
subTitle? | string | Optional subtitle to display |
Returns
Promise<unknown>
A promise that resolves with user's choice (true for OK, false for Cancel)
getDialogContainer
Static getDialogContainer(dialogId): HTMLElement
Get dialog container DOM element by dialog id.
Parameters
| Name | Type | Description |
|---|---|---|
dialogId | string | The element id of the dialog |
Returns
HTMLElement
A dialog container DOM element, or null if not found.
getDialogFooter
Static getDialogFooter(dialogId): HTMLElement
Get dialog footer DOM element by dialog id.
Parameters
| Name | Type | Description |
|---|---|---|
dialogId | string | The element id of the dialog |
Returns
HTMLElement
A dialog footer DOM element, or null if not found.
hasOpenDialog
Static hasOpenDialog(): boolean
Check whether any SDK2 dialog is currently open. Returns false if the SDK is not available or no dialog is on the stack.
Returns
boolean
isAvailable
Static isAvailable(): boolean
Check whether the SDK2 Dialog system is available on the current page. Returns true once the SDK store is registered and dispatchable. False on legacy pages where the SDK isn't mounted, or during SPA bootstrap before the store is registered.
Callers that need to decide between the legacy jQuery dialog renderer and the SDK2/Helix renderer (e.g. helper.dialog.js) should use this predicate rather than walking the Vuex state directly.
Returns
boolean
openExportSettingsDialog
Static openExportSettingsDialog(config): Promise<ExportSettings>
Display the export settings modal.
Parameters
| Name | Type | Description |
|---|---|---|
config | ExportSettingsDialogConfig | Configuration object in which you can specify fileType with the default export fileType ('CSV', 'XLSX', 'PDF'). |
Returns
Promise<ExportSettings>
A promise that resolves with export settings
openScanSamplesModal
Static openScanSamplesModal(config?): Promise<SampleInterface[]>
Display the scan samples modal.
Parameters
| Name | Type | Description |
|---|---|---|
config | ScanSamplesModalProps | Optional configuration for sample scanning behavior. |
Returns
Promise<SampleInterface[]>
A promise that resolves with scanned samples.
showConfirmDialog
Static showConfirmDialog(dialogConfig): Promise<any>
Display a Confirm type modal dialog to get extra consent by the user.
Parameters
| Name | Type | Description |
|---|---|---|
dialogConfig | SDKBasicDialogConfiguration | Dialog configuration object |
Returns
Promise<any>
A promise that resolves when the dialog is interacted with
showDialog
Static showDialog(dialogConfig): Promise<any>
Display a generic dialog
Parameters
| Name | Type | Description |
|---|---|---|
dialogConfig | SDKBasicDialogConfiguration | Dialog configuration object |
Returns
Promise<any>
A promise that when resolved contains the dialog result.
Example
eLabSDK2.UI.Dialog.showDialog({
id: 'confirm-action',
title: 'Confirm Action',
content: '<p>Are you sure you want to proceed with this action?</p>',
width: '50vw',
notices: [{
id: 'warning-notice',
style: 'warning',
contents: 'This action cannot be undone',
title: 'Warning',
icon: 'fas fa-exclamation-triangle',
isVisible: () => true
}],
buttons: {
ok: {
id: 'confirm-btn',
label: 'Confirm',
onClick: () => {
console.log('Action confirmed');
return Promise.resolve(true); // Return Promise<boolean> to close dialog
}
},
cancel: {
id: 'cancel-btn',
label: 'Cancel',
onClick: () => {
console.log('Action cancelled');
return Promise.resolve();
}
}
},
onRendered: () => {
console.log('Dialog rendered');
},
useValidation: true
}).then((result) => {
console.log('Dialog closed with result:', result);
});showErrorDialog
Static showErrorDialog(title, message, width?): Promise<any>
Display a Error type modal dialog to inform the user of an error. This modal closes on ok without any logic.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
title | string | undefined | Dialog title shown on top |
message | string | undefined | Content of the dialog |
width? | number | 350 | Width of the dialog in pixels |
Returns
Promise<any>
A promise that resolves when the dialog is closed
showInfoDialog
Static showInfoDialog(title, message): Promise<any>
Display a Info type modal dialog to inform the user. This modal closes on ok without any logic.
Parameters
| Name | Type | Description |
|---|---|---|
title | string | Dialog title shown on top |
message | string | Content of the dialog |
Returns
Promise<any>
A promise that resolves when the dialog is closed
showValidationMessage
Static showValidationMessage(validationMessage): void
Display a validation error message below a form field.
Parameters
| Name | Type | Description |
|---|---|---|
validationMessage | SDKValidationMessage | Validation message configuration |
Returns
void
triggerOk
Static triggerOk(): void
Trigger onOk function and close dialog.
Returns
void
© 2026 eLabNext
Updated 12 days ago