I managed to implement a custom binding for the jQuery.blockUI plugin, and bound my container DIV with that to my model's IsLoading property. During the AJAX callback I set the IsLoading observable to true.
<div data-bind="blockUI: IsLoading">
...
</div>
And the binding handler:
ko.bindingHandlers.blockUI = {
update: function (element, valueAccessor, allBindingsAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor());
if (value)
$(element).block();
else
$(element).unblock();
}
};
Thank you for the base idea.