0

I would like to show SP.UI.ModalDialog until I process and bind the data to data table. Can any one please do let me know what's wrong in it.

$(document).ready(function() {
    //alert("Hello World");
    var dialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Processing...', 'Request is in progress...' );
        function1();function2();function3();
        dialog .close();
    });
2

Try this,

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

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

    function BindTable() {
        RequestStarted();
        //Logic to bind the table
        RequestEnded();
    }

Ref: Use showWaitScreenWithNoClose How to open or close SP.UI.ModalDialog.showWaitScreenWithNoClose

All the best!!!

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.