You wouldn't happen to have this online somewhere would you?

-keif


scorpi wrote:
> 
> Hey Keif,
> 
> still not working ;( I managed to track the not working part down, while
> working on another element, which uses the same structure:
> 
>               $('urm_user_delcontract').addEvent('click', function(event)
>               {                       
>                       var myRequest = new Request(
>                       {
>                               method: 'get',
>                               url: 'ajax.php',
>                               onSuccess: function()
>                               {
>                                       var contracts_container = 
> $('urm_details_contracts_container'); 
>                                       
>                                       var urm_details_contracts_container = 
> new
> Fx.Slide(contracts_container,{duration: 200});
>                                       
> urm_details_contracts_container.slideOut();
>                                       
> contracts_container.set('load',{onSuccess: function()
>                                               {
>                                                       
> urm_details_contracts_container.slideIn();
>                                               }
>                                       });
> 
>                               
> contracts_container.load('ajax.php?do=urm_user_getcontracts&user=<?php
> echo $user->id; ?>');
>                                       
> $('urm_details_contract_details_container').destroy();
>                               }
>                       }).send('do=urm_user_delcontract&user=<?php echo 
> $user->id;
> ?>&contract=<?php echo $contract['id']; ?>');
>               });
> 
> Everything here works fine, as long as I comment the
> contracts_container.set out. As soon as I try to use it to get the 2nd
> onSuccess to work everything after it won't get executed anymore. The last
> thing that happens is the container sliding out. Any idea?
> 
> Cheers
>  Johannes
> 
> -------- Original-Nachricht --------
>> Datum: Sun, 14 Sep 2008 05:27:38 -0700 (PDT)
>> Von: keif <[EMAIL PROTECTED]>
>> An: scorpi <[EMAIL PROTECTED]>
>> Betreff: Re: onComplete in LOAD will only fire once?
> 
>> You *want* the domready. You need it to execute the script.
>> 
>> Try this:
>> 
>> var container = $('urm_user_details_container');
>> if(container != null){       
>>      var urm_user_details_container_slider = new
>> Fx.Slide(container,{'duration':
>> 200}); 
>>      urm_user_details_container_slider.slideOut(); 
>>      container.set('load', {
>>              'onComplete': function(){
>>                      urm_user_details_container_slider.slideIn();
>>              }
>>      });
>>      container.load('ajax.php?do=urm_user_getdetails&user=".$user['id']."'); 
>> }
>> 
>> 
>> Are you using firefox/firebug? Could throw some console.log() in there to
>> see where we are hitting blocks.
>> 
>> -keif
>> 
>> 
>> scorpi wrote:
>> > 
>> > Hey!
>> > 
>> > Well that didn't work either :( Maybe it's because the code is placed
>> > inside
>> > 
>> > window.addEvent('domready', function()
>> > {
>> > }
>> > 
>> > ? Could that be the cause for the onComplete/onSuccess being only fired
>> > once?
>> > And I noticed it's not only that the onComplete doesn't get fired, it's
>> > more like the request doesn't gets executed any more :(
>> > 
>> > 
>> > keif schrieb:
>> >> this is offhanded - maybe do "onSuccess" instead of "onComplete"?
>> >>
>> >>
>> >>
>> >>     scorpi wrote:
>> >>     Hi there!
>> >>
>> >>     I've got this piece of code which gets echo'd by php - hence the
>> >>     $user['id']:
>> >>
>> >>     if($('urm_user_details_container') != null)
>> >>     {
>> >>             var urm_user_details_container = new
>> >>     Fx.Slide('urm_user_details_container',
>> >>             {
>> >>                 duration: 200
>> >>             });
>> >>            
>> >>    
>> >>
>> urm_user_details_container.slideOut().chain(urm_user_details_container.slideIn);
>> >>
>> >>            
>> >>    
>> >>
>> $('urm_user_details_container').load('ajax.php?do=urm_user_getdetails&user=".$user['id']."');
>> >>
>> >>     }
>> >>
>> >>     It works fine, though sometimes the container won't slide out
>> >>     properly, as the content hasn't been loaded yet. So I tried this:
>> >>
>> >>     if($('urm_user_details_container') != null)
>> >>     {
>> >>             var urm_user_details_container = new
>> >>     Fx.Slide('urm_user_details_container',
>> >>             {
>> >>                 duration: 200
>> >>             });
>> >>             urm_user_details_container.slideOut();
>> >>             $('urm_user_details_container').set('load', onComplete:
>> >>     function()
>> >>             {
>> >>                 urm_user_details_container.slideIn();
>> >>             });
>> >>            
>> >>    
>> >>
>> $('urm_user_details_container').load('ajax.php?do=urm_user_getdetails&user=".$user['id']."');
>> >>
>> >>     }
>> >>
>> >>     From my point of view it should now check, if the object exists
>> >>     and - if it does - create a new slide fx, slide the object out,
>> >>     set onComplete for load, load the new data and finally -
>> >>     onComplete - slide the object back in again. Funny thing is, that
>> >>     it works once, but then if i click again it won't work again! The
>> >>     code is being generated by php and is applied to several buttons
>> >>     with a click event. If I don't use the onComplete-Version it load
>> >>     everything every time. But using onComplete get's it stuck
>> >>     somehow. Would be great if somebody could help me!
>> >>
>> >>     Cheers
>> >>      Johannes
>> >>
>> >>
>> >>
>> >>
>> ------------------------------------------------------------------------
>> >> View message @ 
>> >>
>> http://n2.nabble.com/onComplete-in-LOAD-will-only-fire-once--tp1084703p1086637.html
>>  
>> >>
>> >> To unsubscribe from onComplete in LOAD will only fire once?, click 
>> >> here 
>> >> < (link removed) >. 
>> >>
>> >>
>> > 
>> > 
>> 
>> ______________________________________
>> View message @
>> http://n2.nabble.com/onComplete-in-LOAD-will-only-fire-once--tp1084703p1088569.html
>> 
>> To unsubscribe from onComplete in LOAD will only fire once?, click
>>  (link removed) 
> 
> -- 
> Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
> Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/onComplete-in-LOAD-will-only-fire-once--tp1084703p1092726.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to