Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / src / data / ScriptTagProxy.js
index cddb3b3..a8f9e50 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
@@ -38,6 +38,21 @@ out.print(dataBlock.toJsonString());
 if (scriptTag) {\r
     out.write(");");\r
 }\r
+</code></pre>\r
+ * <p>Below is a PHP example to do the same thing:</p><pre><code>\r
+$callback = $_REQUEST['callback'];\r
+\r
+// Create the output object.\r
+$output = array('a' => 'Apple', 'b' => 'Banana');\r
+\r
+//start output\r
+if ($callback) {\r
+    header('Content-Type: text/javascript');\r
+    echo $callback . '(' . json_encode($output) . ');';\r
+} else {\r
+    header('Content-Type: application/x-json');\r
+    echo json_encode($output);\r
+}\r
 </code></pre>\r
  *\r
  * @constructor\r
@@ -108,7 +123,7 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, {
      * <li>The "arg" argument from the load function</li>\r
      * <li>A boolean success indicator</li>\r
      * </ul>\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
      */\r
     doRequest : function(action, rs, params, reader, callback, scope, arg) {\r
@@ -171,7 +186,7 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, {
      * @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
-     * @private\r
+     * @protected\r
      */\r
     onRead : function(action, trans, res) {\r
         var result;\r
@@ -200,7 +215,7 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, {
      * @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
-     * @private\r
+     * @protected\r
      */\r
     onWrite : function(action, trans, response, rs) {\r
         var reader = trans.reader;\r