Create Dialog
Create Dialog - kintone.createDialog()
Creates and displays a message dialog box on the page.
Function
Desktop
kintone.createDialog(config)
Mobile
For mobile, use the following API:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| config | Object | Required | The dialog configuration. |
| config.title | String | Optional | The title. If ignored, it will not be displayed. |
| config.body | Element object | Optional | The dialog body element. If ignored, it will not be displayed. |
| config.showOkButton | Boolean | Optional | The visibility of the OK button.
|
| config.okButtonText | String | Optional | The text to display on the OK button. If ignored, "OK" will be displayed according to the logged-in user's language. |
| config.showCancelButton | Boolean | Optional | The visibility of the Cancel button.
|
| config.cancelButtonText | String | Optional | Text to display on the Cancel button. If ignored, "Cancel" will be displayed according to the logged-in user's language. |
| config.showCloseButton | Boolean | Optional | The visibility of the Close button.
If not displayed, the function to close the dialog with the Esc key is also disabled. |
| config.beforeClose | Function | Optional | A function to run before closing the dialog by any of the following operations: OK button/Cancel button/Close button/Esc key. The user's selected operation is passed as an argument to the function.
false or a value that becomes false after the Promise is resolved, the dialog will not close |
Returns
A Promise object.
The following values can be retrieved when the Promise object is fulfilled:
| Property | Type | Description |
|---|---|---|
| show | Function | An asynchronous function that displays the created dialog. It has no arguments. The return value is a Promise object.When the dialog is closed, the Promise object is resolved and the following values can be retrieved:
|
| close | Function | A function that closes the dialog. It has no argument or return value. |
Available Pages (Desktop)
However, it cannot be used on the following pages:
- Search results
- Marketplace
Sample Request
|
|
Notes
The Element object specified in the config.body argument is used directly as the dialog body element.
Perform sanitization processing as necessary.