vSphere Client JavaScript API: Modal Interface
The
modal
interface enables your plug-in to manage modal dialog windows.This SDK uses the Structured Clone Algorithm, which has limitations as described in the Mozilla Developer Network (MDN) web doc. Limitations affect Modal, Confirmation Modal, and Shared Modal APIs.
modal.AlertLevel
modal.AlertLevel
Description | Enum:
Clarity adds a standard icon, depending on the alert level. See https://v2.clarity.design/alerts. |
Used by:
modal.ButtonStyle
modal.ButtonStyle
Description | Enum:
Clarity adds default CSS tags, depending on the action importance:
For examples of Clarity button styling, see the Solid Buttons illustrations at https://v2.clarity.design/buttons/#examples. |
Used by:
modal.ButtonType
modal.ButtonType
Description | Enum:
Clarity styles PRIMARY buttons with greater emphasis. See https://v2.clarity.design/buttons. |
Used by:
modal.close()
modal.close()
Signature | Closes the modal dialog box in the parent iFrame. |
Description | Optional data that will be passed to callback function specified by onClosed property at dialog open. |
Parameter: data | Optional data that will be passed to callback function specified by onClosed property at dialog open. |
No data is passed to the callback function if the user clicks the dialog close box.
modal.ConfirmationModalConfig
modal.ConfirmationModalConfig
Description | Specifies the properties of a confirmation modal dialog box. |
Property | Type | Required? | Notes |
---|---|---|---|
content | string | yes | Confirmation message displayed in the dialog. |
title | string | no | Dialog main title. May not contain an icon. (default= '' ) |
AccessibilityTitle | string | no | Used when dialog title is not displayed, such as in a wizard dialog. |
size | no | Width of the dialog box. (Default width is chosen by Clarity. Height is fixed.) | |
closable | boolean | no | Whether the dialog displays a close button. (default= true ) |
onClosed | function(result:any): void | no | Function runs when user closes the dialog. If is called, its parameter is in turn passed to the onClosed() function. |
secondaryTitle | string | no | Optional subtitle for the dialog. |
Used by:
modal.DynamicModalConfig
modal.DynamicModalConfig
Description | Specifies values for some properties of a modal dialog box. |
Property | Type | Required? | Notes |
---|---|---|---|
title | string | no | Dialog title. May not contain an icon. (If not present, no change to dialog title.) |
accessibilityTitle | string | no | Used when dialog title is not displayed, such as in a wizard dialog. |
height | number | no | Dialog height, specified in pixels. (If not present, no change to dialog height.) |
Used by:
modal.getCustomData()
modal.getCustomData()
Signature | modal.getCustomData():any |
Description | Returns the customData object provided when a modal dialog box was opened, or null if no customData object was provided. |
modal.getSharedModalsMap()
modal.getSharedModalsMap()
Signature | modal.getSharedModalsMap(targetPluginId:string, callback:function):void |
Description | Creates listings of modal dialog boxes shared by a specific plug-in and accessible to the calling plug-in. The callback function must have the following signature: function callback(sharedModalsMap:#GUID-A40ACB60-9B9D-4C0F-8FAA-65F0E41B8F26-en_p_d7a6347d-c2a4-4ba8-aec6-e639ba9686c9):void |
modal.ModalButton
modal.ModalButton
Description | Describes button properties. |
Property | Type | Required? | Notes |
---|
Used by:
modal.ModalConfig
modal.ModalConfig
Description | Specifies the properties of a modal dialog box. |
Property | Type | Required? | Notes |
---|---|---|---|
url | string | yes | Location of HTML content for the dialog. |
title | string | no | Dialog title. May not contain an icon. (default= '' ) |
accessibilityTitle | string | no | Used when dialog title is not displayed, such as in a wizard dialog. |
size | (width:number, height:number ) | no | Specify in pixels. Default is chosen by Clarity. See https://v2.clarity.design/modals. |
closable | boolean | no | Whether the dialog displays a close button. (default= true ) |
onClosed | function(result:any): void | no | Function runs when the dialog closes. If modal.close() is called, its parameter is in turn passed to the onClosed() function.Function runs when the dialog closes. If is called, its parameter is in turn passed to the onClosed() function. |
customData | any | no | Data the calling module passes to the dialog. |
contextObjects | any[] | no | IDs of relevant objects the calling module passes to the dialog. |
Used by:
modal.ModalSize
modal.ModalSize
Description | Width of a modal dialog box. |
Property | Type | Required? | Notes |
---|---|---|---|
width | number | yes | Specified in pixels. |
Used by:
modal.open()
modal.open()
Signature | modal.open(configObj:modal.ModalConfig):void |
Description | Opens a modal dialog box specified by the configObj parameter. |
Parameter: configObj | Specifies the properties of this modal dialog box. |
modal.openConfirmationModal()
modal.openConfirmationModal()
Signature | modal.openConfirmationModal(configObj:modal.ConfirmationModalConfig):void |
Description | Opens a lightweight modal dialog box designed to present information and confirmation buttons. |
Parameter: configObj | Specifies the properties of this modal dialog box. |
modal.openSharedModal()
modal.openSharedModal()
Signature | modal.openSharedModal(configObj:#GUID-A40ACB60-9B9D-4C0F-8FAA-65F0E41B8F26-en_GUID-7A73F8A7-B0DD-4D6D-B39E-ACC27CD521F5-en):void |
Description | Opens a modal dialog box that is defined and shared by another plug-in. |
modal.SharedModalConfig
modal.SharedModalConfig
Description | Specifies the properties for opening a shared modal dialog. |
Property | Type | Required? | Notes |
---|---|---|---|
pluginId | string | yes | ID of the plug-in that defines the dialog. |
sharedModalId | string | yes | ID of the shared modal dialog. |
vcGuid | string | yes | The GUID of the vCenter Server instance where the plug-in that defines the dialog is registered. |
objectId | string | no | |
onClosed | function(result:any):void | no | Function runs when user closes the dialog. If is called, its parameter is in turn passed to the onClosed() function. |
contextObjects | any[] | no | IDs of relevant objects the calling module passes to the dialog. |
customData | any | no | Additional data the calling module passes to the dialog. |
modal.setOptions()
modal.setOptions()
Signature | modal.setOptions(configObj:#GUID-A40ACB60-9B9D-4C0F-8FAA-65F0E41B8F26_section_100902d7-9c2f-453e-9418-5bcbef1de3da-en):void |
Description | Called by the parent view to modify some properties for a modal dialog box in the parent iFrame. |
Parameter: configObj | Specifies values for some dialog box properties. |
modal.SharedModalsMap
modal.SharedModalsMap
Description | Information about modal dialog boxes shared by a specific plug-in instance registered with one or more vCenter Server instances. |
Property | Type | Required? | Notes |
---|---|---|---|
sharedModalsInfoByVcGuid | yes | Map of modal dialog boxes shared by a plug-in instance, listed by each vCester Server instance where the plug-in is registered. | |
sharedModalsInfoByVcObjects | no | Reserved for future use. |
modal.VcSharedModalsInfo
modal.VcSharedModalsInfo
Description | Information about modal dialog boxes shared by a plug-in instance registered with a specific vCenter Server instance. |
Property | Type | Required? | Notes |
---|---|---|---|
pluginVersion | string | yes | The plug-in version registered with the vCenter Server instance. |
sharedModalsIds | string[] | yes | List of modal dialog boxes shared by the plug-in. |