Upgrade to ExtJS 3.0.3 - Released 10/11/2009
[extjs.git] / docs / source / RemotingProvider.html
index 1bed9bd..5249ee4 100644 (file)
@@ -1,11 +1,17 @@
-<html>\r
-<head>\r
-  <title>The source code</title>\r
-    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
-    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body  onload="prettyPrint();">\r
-    <pre class="prettyprint lang-js"><div id="cls-Ext.direct.RemotingProvider"></div>/**\r
+<html>
+<head>
+  <title>The source code</title>
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body  onload="prettyPrint();">
+    <pre class="prettyprint lang-js">/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+<div id="cls-Ext.direct.RemotingProvider"></div>/**\r
  * @class Ext.direct.RemotingProvider\r
  * @extends Ext.direct.JsonProvider\r
  * \r
@@ -103,9 +109,15 @@ TestAction.multiply(
     \r
     <div id="cfg-Ext.direct.RemotingProvider-maxRetries"></div>/**\r
      * @cfg {Number} maxRetries\r
-     * Number of times to re-attempt delivery on failure of a call.\r
+     * Number of times to re-attempt delivery on failure of a call. Defaults to <tt>1</tt>.\r
      */\r
     maxRetries: 1,\r
+    \r
+    <div id="cfg-Ext.direct.RemotingProvider-timeout"></div>/**\r
+     * @cfg {Number} timeout\r
+     * The timeout to use for each request. Defaults to <tt>undefined</tt>.\r
+     */\r
+    timeout: undefined,\r
 \r
     constructor : function(config){\r
         Ext.direct.RemotingProvider.superclass.constructor.call(this, config);\r
@@ -118,7 +130,7 @@ TestAction.multiply(
              * @param {Ext.direct.RemotingProvider} provider\r
              * @param {Ext.Direct.Transaction} transaction\r
              */            \r
-            'beforecall',\r
+            'beforecall',            \r
             <div id="event-Ext.direct.RemotingProvider-call"></div>/**\r
              * @event call\r
              * Fires immediately after the request to the server-side is sent. This does\r
@@ -128,7 +140,7 @@ TestAction.multiply(
              */            \r
             'call'\r
         );\r
-        this.namespace = (typeof this.namespace === 'string') ? Ext.ns(this.namespace) : this.namespace || window;\r
+        this.namespace = (Ext.isString(this.namespace)) ? Ext.ns(this.namespace) : this.namespace || window;\r
         this.transactions = {};\r
         this.callBuffer = [];\r
     },\r
@@ -137,8 +149,8 @@ TestAction.multiply(
     initAPI : function(){\r
         var o = this.actions;\r
         for(var c in o){\r
-            var cls = this.namespace[c] || (this.namespace[c] = {});\r
-            var ms = o[c];\r
+            var cls = this.namespace[c] || (this.namespace[c] = {}),\r
+                ms = o[c];\r
             for(var i = 0, len = ms.length; i < len; i++){\r
                 var m = ms[i];\r
                 cls[m.name] = this.createMethod(c, m);\r
@@ -172,8 +184,8 @@ TestAction.multiply(
         if(success){\r
             var events = this.getEvents(xhr);\r
             for(var i = 0, len = events.length; i < len; i++){\r
-                var e = events[i];\r
-                var t = this.getTransaction(e);\r
+                var e = events[i],\r
+                    t = this.getTransaction(e);\r
                 this.fireEvent('data', this, e);\r
                 if(t){\r
                     this.doCallback(t, e, true);\r
@@ -219,11 +231,10 @@ TestAction.multiply(
             url: this.url,\r
             callback: this.onData,\r
             scope: this,\r
-            ts: data\r
-        };\r
+            ts: data,\r
+            timeout: this.timeout\r
+        }, callData;\r
 \r
-        // send only needed data\r
-        var callData;\r
         if(Ext.isArray(data)){\r
             callData = [];\r
             for(var i = 0, len = data.length; i < len; i++){\r
@@ -235,7 +246,7 @@ TestAction.multiply(
 \r
         if(this.enableUrlEncode){\r
             var params = {};\r
-            params[typeof this.enableUrlEncode == 'string' ? this.enableUrlEncode : 'data'] = Ext.encode(callData);\r
+            params[Ext.isString(this.enableUrlEncode) ? this.enableUrlEncode : 'data'] = Ext.encode(callData);\r
             o.params = params;\r
         }else{\r
             o.jsonData = callData;\r
@@ -261,7 +272,7 @@ TestAction.multiply(
             if(!this.callTask){\r
                 this.callTask = new Ext.util.DelayedTask(this.combineAndSend, this);\r
             }\r
-            this.callTask.delay(typeof this.enableBuffer == 'number' ? this.enableBuffer : 10);\r
+            this.callTask.delay(Ext.isNumber(this.enableBuffer) ? this.enableBuffer : 10);\r
         }else{\r
             this.combineAndSend();\r
         }\r
@@ -360,8 +371,8 @@ TestAction.multiply(
     doCallback: function(t, e){\r
         var fn = e.status ? 'success' : 'failure';\r
         if(t && t.cb){\r
-            var hs = t.cb;\r
-            var result = e.result || e.data;\r
+            var hs = t.cb,\r
+                result = Ext.isDefined(e.result) ? e.result : e.data;\r
             if(Ext.isFunction(hs)){\r
                 hs(result, e);\r
             } else{\r
@@ -371,6 +382,6 @@ TestAction.multiply(
         }\r
     }\r
 });\r
-Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider;</pre>    \r
-</body>\r
+Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider;</pre>
+</body>
 </html>
\ No newline at end of file