Home > jQuery, SharePoint, SharePoint 2010 > SharePoint 2010 Modal Dialog

SharePoint 2010 Modal Dialog

SharePoint 2010 supports client object model. This enables developer to invoke operations using client side scripting languages like JavaScript. In this article I am going to post code which can be used to show a modal popup dialog

        var options = SP.UI.$create_DialogOptions();
        options.width = 450;
        options.height = 450;
        options.url = "/_layouts/PageName.aspx";
        options.showClose = true;
        options.title = "Dialog Title";
        options.dialogReturnValueCallback =
            Function.createDelegate(null, modalDialogClosedCallback);
        SP.UI.ModalDialog.showModalDialog(options);

Handler method

function modalDialogClosedCallback(result, value) {
    //Code to handle callback
}
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: