vSphere Client JavaScript API: Modal Interface

The modal interface enables your plug-in to manage modal dialog windows.

modal.open() method

Signaturemodal.open(configObj:ModalConfig):void
DescriptionOpens a modal dialog box specified by the configObj parameter.
Parameter: configObjSpecifies the properties of this modal dialog box.

modal.close() method

Signaturemodal.close(data:any):void
DescriptionCloses the modal dialog box in the parent iframe.
Parameter: dataPasses data to the callback function specified by onClosed property at dialog open.

modal.setOptions() method

Signaturemodal.setOptions(options:DynamicModalOptions):void
DescriptionCalled by the parent view to modify some properties for a modal dialog box in the parent iframe.
Parameter: optionsSpecifies values for some dialog box properties.

modal.getCustomData() method

Signaturemodal.getCustomData():any
DescriptionReturns the customData object provided when a modal dialog box was opened, or null if no customData object was provided.

modal.DynamicModalOptions type

DescriptionSpecifies values for some properties of a modal dialog box.
NameTypeRequired?Notes
titlestringnoDialog title. May not contain an icon. (If not present, no change to dialog title.)
heightnumbernoDialog size. Specified in pixels. (If not specified, no change to dialog height.)

modal.ModalConfig type

DescriptionSpecifies the properties of a modal dialog box.
NameTypeRequired?Notes
urlstringyesLocation of HTML content for the dialog.
titlestringnoDialog title. May not contain an icon. (default='')
size(width:number, height:number)yesDialog size. Specified in pixels.
closablebooleannoWhether the dialog displays a close button. (default=true)
onClosedcallbackFnnoFunction runs when the dialog closes.
customDataanynoData the calling module passes to the dialog.
contextObjectsstring[]noIDs of relevant objects the calling module passes to the dialog.