var options = SP.UI.$create_DialogOptions();
var modalDialog = SP.UI.ModalDialog.showModalDialog(options);
options Property | Description |
---|---|
title | A string that contains the title of the dialog |
url | A string that contains the URL of the page that appears in the dialog. Either url or html must be specified. url takes precedence over html. |
html | An HTML element to display within the dialog. |
x | The x-offset of the dialog as an integer value. |
y | The y-offset of the dialog as an integer value. |
width | The width of the dialog as an integer value. If unspecified and autosize is false the width is set to 768px |
height | The height of the dialog as an integer value. If unspecified and autosize is false the height is set to 576px |
allowMaximize | A Boolean value specifying whether the Maximize button should be shown. |
showMaximized | A Boolean value specifying whether the dialog opens maximized. |
showClose | A Boolean value specifying whether the Close button appears on the dialog. |
autoSize | A Boolean value that specifies whether the dialog platform handles dialog sizing automatically. |
dialogReturnValueCallback | A function pointer that specifies the return callback function. Function takes two parameters: a dialogResult of type SP.UI.DialogResult Enumeration, and a returnValue object that contains any data returned by the dialog. |
args | An object that contains data that are passed to the dialog. |
The SP.UI.ModalDialog
namespace was introduced to the JavaScript Object Model with SharePoint 2010, and is available in subsequent SharePoint versions 2013, Office365, and 2016.
Additional reference materials: