Author: ahonnecke
Date: 2010-09-14 00:56:25 +0200 (Tue, 14 Sep 2010)
New Revision: 30904

Modified:
   
plugins/sfJqueryReloadedPlugin/1.2/branches/ahonnecke/lib/helper/jQueryHelper.php
Log:
adding funcionality in jq_remote_function for the failure callback

Modified: 
plugins/sfJqueryReloadedPlugin/1.2/branches/ahonnecke/lib/helper/jQueryHelper.php
===================================================================
--- 
plugins/sfJqueryReloadedPlugin/1.2/branches/ahonnecke/lib/helper/jQueryHelper.php
   2010-09-13 22:04:04 UTC (rev 30903)
+++ 
plugins/sfJqueryReloadedPlugin/1.2/branches/ahonnecke/lib/helper/jQueryHelper.php
   2010-09-13 22:56:25 UTC (rev 30904)
@@ -298,6 +298,7 @@
        if (isset($options['loading'])) $callback_loading = $options['loading'];
        if (isset($options['complete'])) $callback_complete = 
$options['complete'];
        if (isset($options['success'])) $callback_success = $options['success'];
+       if (isset($options['failure'])) $callback_failure = $options['failure'];
 
        $execute = 'false';
        if ((isset($options['script'])) && ($options['script'] == '1')) 
$execute = 'true';
@@ -346,10 +347,11 @@
        if (isset($type)) $function .= ',async:'.$type;
        if (isset($formData)) $function .= ',data:'.$formData;
        if (isset($update_success) and !isset($callback_success)) $function .= 
',success:function(data, 
textStatus){jQuery(\''.$update_success.'\').'.$updateMethod.'(data);}';
-       if (isset($update_failure)) $function .= 
',error:function(XMLHttpRequest, textStatus, errorThrown){'.$update_failure.'}';
+       if (isset($update_failure) and !isset($callback_failure)) $function .= 
',error:function(XMLHttpRequest, textStatus, 
errorThrown){'.$callback_failure.'}';
        if (isset($callback_loading)) $function .= 
',beforeSend:function(XMLHttpRequest){'.$callback_loading.'}';
        if (isset($callback_complete)) $function .= 
',complete:function(XMLHttpRequest, textStatus){'.$callback_complete.'}';
        if (isset($callback_success)) $function .= ',success:function(data, 
textStatus){'.$callback_success.'}';
+       if (isset($callback_failure)) $function .= 
',error:function(XMLHttpRequest, textStatus, 
errorThrown){'.$callback_failure.'}';
        $function .= ',url:\''.url_for($options['url']).'\'';
        $function .= '})';
 

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to