thanks for that hint,
i changed that and in my sample it will do the job (documentation should
be updated, see: http://malsup.com/jquery/block/#dialog ) ...

The documentation is correct.  Use $.unblockUI() when invoking the
function directly.  Use $.unblockUI when passing the function as an
argument.


however i changed my sample to hide the prompt and show the loader:
"$.blockUI.defaults.pageMessage = '<h3 class="warning">Anfrage wird
bearbeitet</h3><p>bitte warten ...</p>';"

It works fine if you make two changes.  First, do not set async to
false.  There is no reason to do that.  Second, remove the 30ms
timeout.  That's causing things to abort before you can even see the
message.

Also, in your case you don't even need the unblock call in your "yes"
handler because you're immediately invoking an ajax call and the
blocking message will simply be replaced.

Mike




but this never gets shown. instead the prompt stays til ajaxStop() is
reached.

i now have: (beware the linebreaks)

/* ------------------------------------------------------------------ */
$j = jQuery.noConflict();
$j(document).ready(function()
{
        $Ajaxian =
"http://localhost/__kunden_a_bis_z/mEAD/tool/surveyor/admin/Ajaxian.php";;
        $.extend($.blockUI.defaults.overlayCSS, {backgroundColor: '#D4E7F8' });
        $.extend($.blockUI.defaults.pageMessageCSS, {border:'none' });
        $.blockUI.defaults.pageMessage = '<h3 class="warning">Anfrage wird
bearbeitet</h3><p>bitte warten ...</p>';
        $j().ajaxStart($j.blockUI).ajaxStop($j.unblockUI);
        $j('.confirm').click (
        function ()
        {
                $prompt = '<div id="Modal"><h3>Wollen Sie diese Frage wirklich
löschen?</h3><p>Alle zugehörigrn Antworten gehen somit auch
verloren!</p><input type="button" id="ModalYes" value="Ja" /><input
type="button" id="ModalNo" value="Nein" /></div>';
                $j("body").append($prompt);
                $j.blockUI($j("#Modal"), { width: '300px' });
                //
                $j("#ModalYes").click(
                        function() {
                                // hide the prompt
                                console.info ('ajax unblocking UI');
                                $j.unblockUI(); // never gets executed ?
                                $str = "test";
                                //console.info("you clicked yes");
                                $j.ajax({
                                        type: "POST",
                                        url: $Ajaxian,
                                        data: "&action=test",
                                        async: false,
                                        link: $str,
                                        success: function (data) {
                                                $link = $j("#" + 
this.link);//$j("div").find("#" + this.link);
                                                //console.info ($j($link));
                                                $j($link).append (data);
                                                $j($link).fadeIn("slow");
                                        },
                                        error: function (XHRo, errType, errMsg) 
{},
                                        beforeSend: function (XHRo) {},
                                        complete: function (XHRo) {},
                                        timeout: 30
                                });
                                return false;
                        }
                );

                $j('#ModalNo').click(
                        function (){
                                $j.unblockUI();
                                //console.info("you clicked NO");
                                return false;
                        }
                );

                return false;
        });
        $j('#test').hide();
});
/* ------------------------------------------------------------------ */
without linebreaks but you need to replace the "> "'s ...
/* ------------------------------------------------------------------ */

Reply via email to