How to use SharePoint ‘Working on it’ modal dialog


Ahamed Fazil Buhari
SharePoint Developer
Published On :   01 Dec 2017
Visit Count
Today :  3    Total :   177
Plan, Migrate, Secure, Report
SharePoint & Office 365 Tool. Simple & Easy to Use. 15-Day Trial!

Sharegate: Kick-Ass Tool
Think Your SharePoint & Office 365 Are Secure ? Find Out Now!


Hello everyone,

In this article we will see how to use SharePoint’s own modal dialog wherever you want. This will be useful when we are customizing SharePoint functionality or page and if we want to show this message when some background process is running and you are waiting for that so it still feels like you are in SharePoint.

 function SP_WaitScreen() {
             SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {
                 window.parent.eval("window.waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Working on it...', '');");
             });
         }
 
         function SP_WaitScreen_Close() {
             if (window.frameElement != null) {
                 if (window.parent.waitDialog != null) {
                     window.parent.waitDialog.close();
                 }
             }
         }
 

Call SP_WaitScreen() function before initiating your big task and the window will show the below popup. You can still customize the message if you want to,

clip_image001

Once you job is over, you call SP_WaitScreen_Close() function to close the modal popup.

Happy Coding

Ahamed

SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Categories

KWizCom Forms App