Earlier today I was looking at sorting code like this:

<div id="entries">
<div class="entry"><span class="foo">foo1</span><span
class="bar">bar1</span></div>
<div class="entry"><span class="foo">foo2</span><span
class="bar">bar2</span></div>
....
</div>

And in implementing this realized that there can be a considerable
delay in the processing if the number of "#entries div.entry" is high.
So I wanted to use blockUI to let the user know the application is
working.  I tried this:

$("#entries").each(function(prntI,prnt){
        $.blockUI();
        $("div.entry",prnt).sort(function(a,b){
                var x = $("span.foo",a).html();
                var y = $("span.foo",b).html();
                return ((x < y) ? -1 : ((x > y) ? 1 : 0));
        }).appendTo(prnt);
        $.unblockUI();
});

But do not see any messages.  If I add an alert after the $.blockUI();
before the sort, then everything works as expected (with the exception
of the unwanted alert).  Is there a way to block -> sort -> unblock?
I am using blockUI v1.26 & jQuery v1.1.3.1

p.s. the sort thread that started this is:
http://groups.google.com/group/jquery-en/browse_frm/thread/e0d6c199552dd1f7

Reply via email to