Monday, 19 September 2016

"Working on it..." Custom Dialog Box in SharePoint

 using Javascript/Jquery(JSOM)

Introduction

This article is about creating "Working on it" Custom Dialog Box  in SharePoint.

Let's Start


Define a global Variable 'waitDialog'.

 var waitDialog = null;  

   While calling a Save function using Rest API or any long Operation function, Call RequestStarted() function at the starting and just before the end of the Save function,  Call  RequestEnded() function.


 function RequestStarted() {  
   ExecuteOrDelayUntilScriptLoaded(ShowWaitScreen, "sp.js");  
   };  
  function RequestEnded() {  
   try {  
    waitDialog.close();  
    waitDialog = null;  
   } catch (ex) { }  
   };  
   function ShowWaitScreen() {  
   try {  
    if (waitDialog == null) {  
    //waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Processing...', 'Please wait while request is in progress.', 100, 380);  
    waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose(SP.Res.dialogLoading15);  
    }  
   } catch (ex) { }  
   }  



   Instead of "Working on it..." Dialog box ,For custom dialog box use following code:-

  waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Processing...', 'Please wait while request is in progress.', 100, 380);  




6 comments:

  1. This information you provided in the blog that is really unique I love it!! Thanks for sharing such a great blog. Keep posting..
    Sharepoint training in Noida
    Sharepoint course in Noida
    Sharepoint training institute in Noida

    ReplyDelete
  2. This information you provided in the blog that is really unique I love it!! Thanks for sharing such a great blog. Keep posting..
    Sharepoint training in Delhi
    Sharepoint training institute in Delhi
    Sharepoint course in Delhi

    ReplyDelete
  3. Your writing style is engaging and made the content enjoyable to read. I look forward to exploring more of your posts.

    South Kerala Tour Packages
    Kerala Backwaters Boat Rowing
    Best Time to Visit Kerala



    ReplyDelete
  4. What an interesting take on this subject! I appreciate the depth of your analysis. Keep sharing such great content

    Golden Triangle India Tour
    7-Day Golden Triangle India Tour
    Best Delhi-Agra-Jaipur Tours





    ReplyDelete
  5. Loved reading this! The way you explained the topic made it so easy to understand. Looking forward to your next post.

    India Train Tours Packages
    India Tour Packages
    Luxury India Tour Packages
    India Train Tours Packages

    ReplyDelete