Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / docs / source / RemotingProvider.html
index 1bed9bd..3b8fd70 100644 (file)
@@ -1,5 +1,6 @@
 <html>\r
 <head>\r
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    \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
@@ -103,9 +104,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 +125,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 +135,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 +144,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 +179,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 +226,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 +241,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 +267,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 +366,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