18

Sharepoint 2013: In have custom JavaScript code that makes Ajax calls. While loading I'd like to show Sharepoint's loading pop in:

working_on_it

That is the one that greys out the underlying page and centers a loading box with shadows.

Any hint how to call the "show" function and the "remove" function as soon as my Ajax completes?

Thanks, Juergen

Arsalan Adam Khatri
  • 14,531
  • 3
  • 36
  • 59
Juergen Riemer
  • 1,057
  • 2
  • 11
  • 23

3 Answers3

33

Juergen,

The below article should help:
http://www.collabware.com/blog/2013/03/22/tips-tricks-sharepoint-2013-modal-dialogs

You have SP.UI.ModalDialog.showWaitScreenWithNoClose which can be used..

function RequestEnded(sender, args) {
  try {
    waitDialog.close();
    waitDialog = null;
  } catch (ex) { }
};

function RequestStarted(sender, args) {
   ExecuteOrDelayUntilScriptLoaded(ShowWaitDialog, "sp.js");
};

function ShowWaitDialog() {
   try {
      if (waitDialog == null) {
         waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Processing...', 'Please wait while request is in progress...', 76, 330);
      }
   } catch (ex) { }
};
Arsalan Adam Khatri
  • 14,531
  • 3
  • 36
  • 59
0

//show and hide waiting on it javascript

    function waitMessage() {
        window.parent.eval("window.waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Processing...', '', 90, 300);");
    }

    function closeMessage() {
        if (window.frameElement != null) {
            if (window.parent.waitDialog != null) {
                window.parent.waitDialog.close();
            }
        }
    }
-5

u can use this $.ShowProcessing("Refreshing Collections...");

Mohan
  • 1