-<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.data.DirectProxy"></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.data.DirectProxy"></div>/**\r
* @class Ext.data.DirectProxy\r
* @extends Ext.data.DataProxy\r
*/\r
\r
switch (action) {\r
case Ext.data.Api.actions.create:\r
- args.push(params[reader.meta.root]); // <-- create(Hash)\r
+ args.push(params.jsonData[reader.meta.root]); // <-- create(Hash)\r
break;\r
case Ext.data.Api.actions.read:\r
- if(this.paramOrder){\r
- for(var i = 0, len = this.paramOrder.length; i < len; i++){\r
- args.push(params[this.paramOrder[i]]);\r
+ // If the method has no parameters, ignore the paramOrder/paramsAsHash.\r
+ if(directFn.directCfg.method.len > 0){\r
+ if(this.paramOrder){\r
+ for(var i = 0, len = this.paramOrder.length; i < len; i++){\r
+ args.push(params[this.paramOrder[i]]);\r
+ }\r
+ }else if(this.paramsAsHash){\r
+ args.push(params);\r
}\r
- }else if(this.paramsAsHash){\r
- args.push(params);\r
}\r
break;\r
case Ext.data.Api.actions.update:\r
- args.push(params[reader.meta.idProperty]); // <-- save(Integer/Integer[], Hash/Hash[])\r
- args.push(params[reader.meta.root]);\r
+ args.push(params.jsonData[reader.meta.root]); // <-- update(Hash/Hash[])\r
break;\r
case Ext.data.Api.actions.destroy:\r
- args.push(params[reader.meta.root]); // <-- destroy(Int/Int[])\r
+ args.push(params.jsonData[reader.meta.root]); // <-- destroy(Int/Int[])\r
break;\r
}\r
\r
* @private\r
*/\r
onWrite : function(action, trans, result, res, rs) {\r
- this.fireEvent("write", this, action, result, res, rs, trans.request.arg);\r
- trans.request.callback.call(trans.request.scope, result, res, true);\r
+ var data = trans.reader.extractData(result);\r
+ this.fireEvent("write", this, action, data, res, rs, trans.request.arg);\r
+ trans.request.callback.call(trans.request.scope, data, res, true);\r
}\r
});\r
\r
-</pre> \r
-</body>\r
+</pre>
+</body>
</html>
\ No newline at end of file