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

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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