blockUI works but unBlockUI Isn't
Asked Answered
W

3

5

I've implemented block UI as this request can take a little, time when the ajax request starts everything works as expected.

But when the ajax request finishes and the msgbox is shown, the UI doesn't unblock!

Any ideas?

I'm using IE8.

$().ajaxStart($.blockUI); 
$().ajaxStop($.unblockUI); 

function ChangeCompanyState(companyId, state) {
    var parameters = "{companyId:" + companyId + ",state:\"" + state + "\"}";
    $.ajax({
        type: "POST",
        url: "Ajax/AjaxFragments.aspx/ChangeCompanyState",
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(msg) {
            if (msg.d.length > 1) {
                alert(msg.d);
                $.unblockUI();
            }
            else {
                //Theres no message to process success.
                window.location.reload();
            }
        }

    });
}
Wulf answered 18/9, 2009 at 7:44 Comment(0)
R
0

As told here, using

<meta http-equiv="X-UA-Compatible" content="IE=7" />

seems to fix the problem. I didn't get any other way to solve it in my own project.

Roeder answered 6/10, 2009 at 16:17 Comment(0)
M
8
$.unblockUI();
$(".blockUI").fadeOut("slow"); 
Morette answered 2/11, 2009 at 15:16 Comment(2)
+1 This solution just saved me from a huge headache. Thanks!!Cortney
It's a workaround but worked perfectly. I wrapped the second line with if ($.browser.msie && $.browser.version < 9) {Bumper
W
4

I had the same, and resolved by using parentesis in unbluckUI sentence.

// block when ajax activity starts
function beginRequestHandler(sender, args) {
    $.blockUI({ message: '<h1><img src="loading.gif" /> Just a moment...</h1>' });
}

// unblock when ajax activity stops 
function endRequestHandler(sender, args) {
    $.unblockUI(); // previously was $.unblockUI;
}

HTH Milton

Walachia answered 15/10, 2010 at 13:8 Comment(1)
makes sense indeed, without them you are not actually calling the function. Documentation states otherwise however, this works.Intermediary
R
0

As told here, using

<meta http-equiv="X-UA-Compatible" content="IE=7" />

seems to fix the problem. I didn't get any other way to solve it in my own project.

Roeder answered 6/10, 2009 at 16:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.