Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / src / data / HttpProxy.js
index bf19ffc..d29d28a 100644 (file)
@@ -1,5 +1,5 @@
 /*!
 /*!
- * Ext JS Library 3.0.3
+ * Ext JS Library 3.1.0
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
@@ -17,7 +17,7 @@
  * @constructor\r
  * @param {Object} conn\r
  * An {@link Ext.data.Connection} object, or options parameter to {@link Ext.Ajax#request}.\r
  * @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
  * 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
@@ -95,8 +95,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
      * <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
      * @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
      */\r
     doRequest : function(action, rs, params, reader, cb, scope, arg) {\r
         var  o = {\r
@@ -113,7 +114,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
 \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
         if (params.jsonData) {\r
             o.jsonData = params.jsonData;\r
         } else if (params.xmlData) {\r
@@ -122,14 +122,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
             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
         // 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
         if(this.useAjax){\r
 \r
             Ext.applyIf(o, this.conn);\r
@@ -186,7 +182,7 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
      * @fires loadexception (deprecated)\r
      * @fires exception\r
      * @fires load\r
      * @fires loadexception (deprecated)\r
      * @fires exception\r
      * @fires load\r
-     * @private\r
+     * @protected\r
      */\r
     onRead : function(action, o, response) {\r
         var result;\r
      */\r
     onRead : function(action, o, response) {\r
         var result;\r
@@ -225,7 +221,7 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {
      * @param {Object} res The server response\r
      * @fires exception\r
      * @fires write\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
      */\r
     onWrite : function(action, o, response, rs) {\r
         var reader = o.reader;\r