ra170
ra170

Reputation: 3683

drop down list with jquery and blockui

I almost figure this out, can anyone tell me as to why my $.unblock never executes?

$(document).ready(function () {
    $('#somedropdown').change(function () {
        $.blockUI({
            css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: '.5',
                color: '#fff'
            }
        });

        var dropdownvalue = $('#somedropdown').val();
        var xaml1obj = document.getElementById("Xaml1");
        $.getScript(xaml1obj.Content.scriptableObject.InitializeSomething(dropdownvalue), function () { $.unblockUI(); });
    });
}); 

Upvotes: 0

Views: 973

Answers (1)

ra170
ra170

Reputation: 3683

The solution to this was to call unblock method from the managed code (C# to javascript). In other words, when you make a selection you call block, do your work (i.e. call server, etc) and then call unblock at the end. The calls to block and unblock are made from managed code (c#) but the actual work is performed in the javascript (because this is jQuery)

Upvotes: 0

Related Questions