- How to Add Extensible Actions to Entities?
- How to Add Extensible Actions to Tabs?
- How to Configure Callback Hooks/Events?
- How to Do Routing in an iFrame
- How to Configure Out-of-the-box Actions?
- How to add custom branding?
- How to Override Theme Colors?
- How to Add Custom Global Dialog?
- How to Configure Global and Locale-Specific Date Formats?
How to Add Custom Global Dialog?
The GlobalDialogService.showCustomDialog() function is used to display a custom dialog box.
How to Invoke Custom Global Dialog
In workspace we have extensibility to open a custom global dialog.
The following is the example for configurations to open the dialog:
let dialogRef = GlobalDialogService.showCustomDialog(
{
dialogDef: {
config: {
height: "400px",
width: "400px",
}
},
data: {
title: "Dialog",
iframeUrl: http://localhost:3000/assets/index.html,
iframeId: "frame1",
dialogId : "dialog1",
dialogCSSId: "dialog-css-id",
dialogCSS: `.msg-title { color: red; }`,
showTitleBar: true,
btns: [
{
displayText: "close",
primary: false,
id: "close",
closeOnClick: true
}
],
},
}
);
// Close the dialog using the Reference of the dialog.
dialogRef.close();
// Listen to the event emitted by the dialog and perform actions accordingly.
dialogRef.event.subscribe((e) => {
if(e["data"]["id"] === "ok") {
dialogRef.close();
}
});
Parameters used for Custom Global Dialog
dialogDef: This object contains configuration options for dialog. It has the following properties.
For example:
dialogDef : {
componentClass: "QppDialog",
config : {
height: "400px",
width: "400px"
}
}
- config: Configuration settings for the dialog's appearance. This includes the height, width, minWidth, minHeight, maxHeight, maxWidth,backdropClass, backdropClose of the dialog.
For example:
config : {
height: "400px",
width: "400px",
backdropClose: true,
maxHeihgt: "800px",
maxWidth: "800px
}
- data: This object contains the data to be displayed in the dialog and controls its behavior. It has the following properties:
`title` (String): The title of the dialog
`iframeUrl` (String): The URL of the web page or content you want to display within an iframe in the dialog.
For example:
iframeUrl: http://localhost:3000/assets/index.html
`iframeId` (String): Id for the ifram within the dialog.
`dialogId` (String): Id for the dialog itself.
`dialogCSSId` (String): Id for applying custom CSS styles to dialog.
`closeBtnInTitleBar` (Boolean): Show Close Button in Title Bar.
`dialogCSS` (String): Custom CSS styles to be applied to the dialog.
For example:
dialogCSS: `.msg-title { color: red; }`
`showTitleBar` (Boolean): Determines whether the show the title bar of the dialog.
`btns` (Array): An array of buttons objects to be displayed in the dialog. Each button object can have the following properties:
- `displayText` (String): The text displayed on the button.
- `primary` (Boolean): Whether the button is the primary action.
- `id` (String): Id for the button.
- `closeOnClick` (Boolean): Whether the dialog shouldf be closed when this button is clicked.
To download sample, click here