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

3 Answers 3

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) { }
};
6
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...");

1
  • There is no ShowProcessingmethod on $ by default Oct 10, 2014 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.