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

up vote 32 down vote accepted

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

//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();
            }
        }
    }

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

  • There is no ShowProcessingmethod on $ by default – Robert Lindgren Oct 10 '14 at 9:46

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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