[jQuery] Re: plugin blockUI what do i do wrong ?

2007-05-26 Thread Michael Stuhr


Mike Alsup schrieb:

Glad to hear that you've got it working, Micha.  Maybe you can post a
link to your code instead of  sending it all?

  

sure, i can do that.

http://onenterframe.de/ajax/

micha


[jQuery] Re: plugin blockUI what do i do wrong ?

2007-05-25 Thread Mike Alsup


You need to change this:

$j.unblockUI;

to this:

$j.unblockUI();

Mike



$j(#ModalYes).click(
function() {
$j.unblockUI;
console.info(you clicked yes);
return false;
}
);

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


[jQuery] Re: plugin blockUI what do i do wrong ?

2007-05-25 Thread Michael Stuhr


Mike Alsup schrieb:

You need to change this:

$j.unblockUI;

to this:

$j.unblockUI();

Mike




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 ) ...


however i changed my sample to hide the prompt and show the loader: 
$.blockUI.defaults.pageMessage = 'h3 class=warningAnfrage wird 
bearbeitet/h3pbitte warten .../p';


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=warningAnfrage wird 
bearbeitet/h3pbitte warten .../p';

$j().ajaxStart($j.blockUI).ajaxStop($j.unblockUI);
$j('.confirm').click (
function ()
{
		$prompt = 'div id=Modalh3Wollen Sie diese Frage wirklich 
löschen?/h3pAlle zugehörigrn Antworten gehen somit auch 
verloren!/pinput 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 ...
/* -- */



$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=warningAnfrage wird 
bearbeitet/h3pbitte warten .../p';
$j().ajaxStart($j.blockUI).ajaxStop($j.unblockUI);
$j('.confirm').click (
function ()
{
$prompt = 'div id=Modalh3Wollen Sie diese Frage wirklich löschen?/h3pAlle zugehörigrn Antworten gehen somit auch 
verloren!/pinput 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: 

[jQuery] Re: plugin blockUI what do i do wrong ?

2007-05-25 Thread Michael Stuhr


Mike Alsup schrieb:

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.


ok, that was unclear to me.





however i changed my sample to hide the prompt and show the loader:
$.blockUI.defaults.pageMessage = 'h3 class=warningAnfrage wird
bearbeitet/h3pbitte 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.
oops, i thought the timeout was there to end the waiting / pending 
status of the ajax call after given time ... (note to myself: RTFM!)


that really caused a lot of trouble: if you set timeout and use async = 
true, you always get an undefined error. bah!




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.


i know, i just wanted to make sure, cause in my implementation (not the 
example) i had the case where two modals where there in IE6. i mixed up 
the code a bit. sorry if this is confusing.


it might be a little bit lame for most of the subscribers on this list, 
but i would like to post the working example here, in case anyone else 
is having problems with this :-)


i would like to here some opinions on that before, cause it's really a 
high traffic list, and i don't want to spam this list with my code

...


micha


[jQuery] Re: plugin blockUI what do i do wrong ?

2007-05-25 Thread Mike Alsup


Glad to hear that you've got it working, Micha.  Maybe you can post a
link to your code instead of  sending it all?

Mike



i know, i just wanted to make sure, cause in my implementation (not the
example) i had the case where two modals where there in IE6. i mixed up
the code a bit. sorry if this is confusing.

it might be a little bit lame for most of the subscribers on this list,
but i would like to post the working example here, in case anyone else
is having problems with this :-)

i would like to here some opinions on that before, cause it's really a
high traffic list, and i don't want to spam this list with my code