SharePoint 2013 showmodaldialog pop-up mode window

Source: Internet
Author: User

1. SharePoint pop-up box

This article describes the problem of undefined showmodaldialog when sp. UI. modaldialog. showmodaldialog is used in SharePoint 2013.

Function showdialog (title, URL, width, height) {var Options = {URL: URL, argS: 7, Title: title, dialogreturnvaluecallback: dialogcallback}; If (width! = Undefined) options. width = width; If (height! = Undefined) options. height = height; SP. UI. modaldialog. showmodaldialog (options);} // function dialogcallback (dialogresult, returnvalue) to receive the return value {// Where dialogresult = 1 indicates OK, dialogresult = 0 indicates that if (returnvalue! = NULL & dialogresult = 1) {} return ;}

 

The above code works normally in SharePoint 2010, that is, a window with a pattern is displayed.

But in SharePoint 2013, there will be (modaldialog) showmodaldialog undefined errors. How can this problem be solved? Use sp.sod.exe cutefunc:

1 function showdialog (title, URL, width, height) {2 var Options = {3 URL: URL, 4 ARGs: 7, 5 Title: title, 6 dialogreturnvaluecallback: dialogcallback 7 }; 8 If (width! = Undefined) options. width = width; 9 If (height! = Undefined) options. height = height; 10 11 sp.sod.exe cutefunc (12 'SP. UI. dialog. js', 13' sp. UI. modaldialog. showmodaldialog ', 14 function () {15 sp. UI. modaldialog. showmodaldialog (options); 16}); 17 18} 19 20 // Method 21 function dialogcallback (dialogresult, returnvalue) {22 // Where dialogresult = 1 indicates OK, dialogresult = 0, indicating that 23 if (returnvalue! = NULL & dialogresult = 1) {24 25} 26 return; 27}

 

2. Close the dialog box

// Disable function closedialog () {window. frameelement. cancelpopup ();}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.