The component id of the current view instance.
The configuration of the component to render.
The rendered HTML of the view.
The configuration of the view to render.
The viewFields of the view.
Closes the current dialog or the one with the specified id.
// Close the current dialog.
CSL.dialog.close();
// Get dialogs by view options.
const dialogs = CSL.dialog.getDialogsByViewOptions('Product', 'Get All Products');
// Close all found dialogs.
dialog.forEach((dialog) => {
const dialogId = CSL.dialog.getComponentIdOfDialog(dialog);
CSL.dialog.close(dialogId);
});
Optional
componentId: stringGet the child dialogs of the component. A child dialog is a dialog that is opened from another component.
// Get the child dialogs of current dialog.
let childDialogs1 = CSL.dialog.getChildDialogsByComponentId();
// Get the child dialogs of component with id 'abj36'.
let childDialogs2 = CSL.dialog.getChildDialogsByComponentId('abj36');
Optional
componentId: stringThe id of the component.
Gets the component id of a dialog.
// Get dialogs based on view options.
const dialogs = CSL.dialog.getDialogsByViewOptions('Product', 'Get All Products');
// Get the id of the first dialog.
const dialogComponentId = CSL.dialog.getComponentIdOfDialog(dialogs[0]);
The dialog instance on which the component id will be fetched.
Get the dialogs that have specified view options.
// Get dialogs that have specified view and object names.
let dialogs1 = CSL.dialog.getDialogsByViewOptions('Product', 'Get All Products');
// Get dialogs from specific component.
let dialogInstances = CSL.dialog.getChildDialogsByComponentId();
let dialogs2 = CSL.dialog.getDialogsByViewOptions('Product', 'Get All Products', dialogInstances);
The object name of the component.
The view name of the component.
Optional
dialogInstances: AdmDialogRef<IDialogInstance>[]The dialogs to search through. If not specified, all dialogs on the page will be used.
Get a dialog by its component id.
// This view is in a dialog and you want the dialog instance of this view.
let currentDialog = CSL.dialog.getInstance();
// The parent of this dialog is also in a dialog and you want to get the parent dialog instance.
let parentDialog = CSL.dialog.getInstance(currentDialog.parentId);
Optional
componentId: stringThe unique identifier of the component.
Opens a new dialog with the provided view.
CSL.dialog.open('Product', 'Get Product', [{'name': 'John', 'age': 35}], undefined, componentId);
// When no componentId is defined, the id of the current component will be used.
CSL.dialog.open('Product', 'Get Product', [{'name': 'John', 'age': 35}]);
// When the dialog should act like a modal dialog with a gray overlay.
CSL.dialog.open('Product', 'Get Product', [{'name': 'John', 'age': 35}], { isModal: true });
// When the state of the dialog needs to be tracked, a promise is returned.
let dialogState = CSL.dialog.open('Product', 'Get Product', [{'name': 'John', 'age': 35}], { trackState: true });
dialogState.then((closedAfterSuccessfulSave) => {
if (closedAfterSuccessfulSave) {
// Something to do when the dialog has been saved successfully.
} else {
// Something to do when the dialog has been closed without saving the data.
}
})
The name of the object which contains the field
The name of the view to present.
Optional
contextRecords: ValueObject<any>[]The context records to pass with the prepare call.
Optional
cslDialogOptions: CslDialogOpenOptionsAny options to use for opening the dialog.
Optional
componentId: stringThe id of the component.
Generated using TypeDoc
This class supports the functionality for custom scripting on a dialog. You can access all the methods by using the namespace
CSL.dialog
.