Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / docs / source / HttpProxy.html
index 6e27e88..5ae9fa8 100644 (file)
@@ -1,17 +1,12 @@
-<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.data.HttpProxy"></div>/**\r
+<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
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js"><div id="cls-Ext.data.HttpProxy"></div>/**\r
  * @class Ext.data.HttpProxy\r
  * @extends Ext.data.DataProxy\r
  * <p>An implementation of {@link Ext.data.DataProxy} that processes data requests within the same\r
@@ -24,7 +19,7 @@
  * @constructor\r
  * @param {Object} conn\r
  * An {@link Ext.data.Connection} object, or options parameter to {@link Ext.Ajax#request}.\r
- * <p>Note that if this HttpProxy is being used by a (@link Ext.data.Store Store}, then the\r
+ * <p>Note that if this HttpProxy is being used by a {@link Ext.data.Store Store}, then the\r
  * Store's call to {@link #load} will override any specified <tt>callback</tt> and <tt>params</tt>\r
  * options. In this case, use the Store's {@link Ext.data.Store#events events} to modify parameters,\r
  * or react to loading events. The Store's {@link Ext.data.Store#baseParams baseParams} may also be\r
@@ -102,8 +97,9 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
      * <li><tt>r</tt> : Ext.data.Record[] The block of Ext.data.Records.</li>\r
      * <li><tt>options</tt>: Options object from the action request</li>\r
      * <li><tt>success</tt>: Boolean success indicator</li></ul></p></div>\r
-     * @param {Object} scope The scope in which to call the callback\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the callback function is executed. Defaults to the browser window.\r
      * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
+     * @protected\r
      */\r
     doRequest : function(action, rs, params, reader, cb, scope, arg) {\r
         var  o = {\r
@@ -120,7 +116,6 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
 \r
         // If possible, transmit data using jsonData || xmlData on Ext.Ajax.request (An installed DataWriter would have written it there.).\r
         // Use std HTTP params otherwise.\r
-        // TODO wrap into 1 Ext.apply now?\r
         if (params.jsonData) {\r
             o.jsonData = params.jsonData;\r
         } else if (params.xmlData) {\r
@@ -129,14 +124,10 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
             o.params = params || {};\r
         }\r
         // Set the connection url.  If this.conn.url is not null here,\r
-        // the user may have overridden the url during a beforeaction event-handler.\r
+        // the user must have overridden the url during a beforewrite/beforeload event-handler.\r
         // this.conn.url is nullified after each request.\r
-        if (this.conn.url === null) {\r
-            this.conn.url = this.buildUrl(action, rs);\r
-        }\r
-        else if (this.restful === true && rs instanceof Ext.data.Record && !rs.phantom) { // <-- user must have intervened with #setApi or #setUrl\r
-            this.conn.url += '/' + rs.id;\r
-        }\r
+        this.conn.url = this.buildUrl(action, rs);\r
+\r
         if(this.useAjax){\r
 \r
             Ext.applyIf(o, this.conn);\r
@@ -185,7 +176,7 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
         }\r
     },\r
 \r
-    /**\r
+    <div id="method-Ext.data.HttpProxy-onRead"></div>/**\r
      * Callback for read action\r
      * @param {String} action Action name as per {@link Ext.data.Api.actions#read}.\r
      * @param {Object} o The request transaction object\r
@@ -193,7 +184,7 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
      * @fires loadexception (deprecated)\r
      * @fires exception\r
      * @fires load\r
-     * @private\r
+     * @protected\r
      */\r
     onRead : function(action, o, response) {\r
         var result;\r
@@ -225,14 +216,14 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
         // NOTE reader.readResponse does not currently return Ext.data.Response\r
         o.request.callback.call(o.request.scope, result, o.request.arg, result.success);\r
     },\r
-    /**\r
+    <div id="method-Ext.data.HttpProxy-onWrite"></div>/**\r
      * Callback for write actions\r
      * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
      * @param {Object} trans The request transaction object\r
      * @param {Object} res The server response\r
      * @fires exception\r
      * @fires write\r
-     * @private\r
+     * @protected\r
      */\r
     onWrite : function(action, o, response, rs) {\r
         var reader = o.reader;\r
@@ -269,6 +260,6 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
         }\r
         Ext.data.HttpProxy.superclass.destroy.call(this);\r
     }\r
-});</pre>
-</body>
+});</pre>    \r
+</body>\r
 </html>
\ No newline at end of file