Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / docs / source / Direct.html
index 970c570..c53209d 100644 (file)
@@ -3,8 +3,8 @@
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>The source code</title>
-  <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
-  <script type="text/javascript" src="../prettify/prettify.js"></script>
+  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
   <style type="text/css">
     .highlight { display: block; background-color: #ddd; }
   </style>
 </head>
 <body onload="prettyPrint(); highlight();">
   <pre class="prettyprint lang-js"><span id='Ext-data-proxy-Direct'>/**
-</span> * @class Ext.data.proxy.Direct
- * @extends Ext.data.proxy.Server
- * 
- * This class is used to send requests to the server using {@link Ext.direct}. When a request is made,
- * the transport mechanism is handed off to the appropriate {@link Ext.direct.RemotingProvider Provider}
- * to complete the call.
- * 
- * ## Specifying the function
+</span> * This class is used to send requests to the server using {@link Ext.direct.Manager Ext.Direct}. When a
+ * request is made, the transport mechanism is handed off to the appropriate
+ * {@link Ext.direct.RemotingProvider Provider} to complete the call.
+ *
+ * # Specifying the function
+ *
  * This proxy expects a Direct remoting method to be passed in order to be able to complete requests.
  * This can be done by specifying the {@link #directFn} configuration. This will use the same direct
  * method for all requests. Alternatively, you can provide an {@link #api} configuration. This
  * allows you to specify a different remoting method for each CRUD action.
- * 
- * ## Parameters
+ *
+ * # Parameters
+ *
  * This proxy provides options to help configure which parameters will be sent to the server.
  * By specifying the {@link #paramsAsHash} option, it will send an object literal containing each
  * of the passed parameters. The {@link #paramOrder} option can be used to specify the order in which
  * the remoting method parameters are passed.
- * 
- * ## Example Usage
- * 
+ *
+ * # Example Usage
+ *
  *     Ext.define('User', {
  *         extend: 'Ext.data.Model',
  *         fields: ['firstName', 'lastName'],
  */
 Ext.define('Ext.data.proxy.Direct', {
     /* Begin Definitions */
-    
+
     extend: 'Ext.data.proxy.Server',
     alternateClassName: 'Ext.data.DirectProxy',
-    
+
     alias: 'proxy.direct',
-    
+
     requires: ['Ext.direct.Manager'],
-    
+
     /* End Definitions */
-   
-<span id='Ext-data-proxy-Direct-cfg-paramOrder'>   /**
-</span>     * @cfg {Array/String} paramOrder Defaults to &lt;tt&gt;undefined&lt;/tt&gt;. A list of params to be executed
-     * server side.  Specify the params in the order in which they must be executed on the server-side
-     * as either (1) an Array of String values, or (2) a String of params delimited by either whitespace,
-     * comma, or pipe. For example,
-     * any of the following would be acceptable:&lt;pre&gt;&lt;code&gt;
-paramOrder: ['param1','param2','param3']
-paramOrder: 'param1 param2 param3'
-paramOrder: 'param1,param2,param3'
-paramOrder: 'param1|param2|param'
-     &lt;/code&gt;&lt;/pre&gt;
+
+<span id='Ext-data-proxy-Direct-cfg-paramOrder'>    /**
+</span>     * @cfg {String/String[]} paramOrder
+     * Defaults to undefined. A list of params to be executed server side.  Specify the params in the order in
+     * which they must be executed on the server-side as either (1) an Array of String values, or (2) a String
+     * of params delimited by either whitespace, comma, or pipe. For example, any of the following would be
+     * acceptable:
+     *
+     *     paramOrder: ['param1','param2','param3']
+     *     paramOrder: 'param1 param2 param3'
+     *     paramOrder: 'param1,param2,param3'
+     *     paramOrder: 'param1|param2|param'
      */
     paramOrder: undefined,
 
 <span id='Ext-data-proxy-Direct-cfg-paramsAsHash'>    /**
 </span>     * @cfg {Boolean} paramsAsHash
-     * Send parameters as a collection of named arguments (defaults to &lt;tt&gt;true&lt;/tt&gt;). Providing a
-     * &lt;tt&gt;{@link #paramOrder}&lt;/tt&gt; nullifies this configuration.
+     * Send parameters as a collection of named arguments.
+     * Providing a {@link #paramOrder} nullifies this configuration.
      */
     paramsAsHash: true,
 
@@ -87,30 +86,32 @@ paramOrder: 'param1|param2|param'
      * for Store's which will not implement a full CRUD api.
      */
     directFn : undefined,
-    
+
 <span id='Ext-data-proxy-Direct-cfg-api'>    /**
-</span>     * @cfg {Object} api The same as {@link Ext.data.proxy.Server#api}, however instead of providing urls, you should provide a direct
+</span>     * @cfg {Object} api
+     * The same as {@link Ext.data.proxy.Server#api}, however instead of providing urls, you should provide a direct
      * function call.
      */
-    
+
 <span id='Ext-data-proxy-Direct-cfg-extraParams'>    /**
-</span>     * @cfg {Object} extraParams Extra parameters that will be included on every read request. Individual requests with params
+</span>     * @cfg {Object} extraParams
+     * Extra parameters that will be included on every read request. Individual requests with params
      * of the same name will override these params when they are in conflict.
      */
-    
+
     // private
     paramOrderRe: /[\s,|]/,
-    
+
     constructor: function(config){
         var me = this;
-        
+
         Ext.apply(me, config);
         if (Ext.isString(me.paramOrder)) {
             me.paramOrder = me.paramOrder.split(me.paramOrderRe);
         }
         me.callParent(arguments);
     },
-    
+
     doRequest: function(operation, callback, scope) {
         var me = this,
             writer = me.getWriter(),
@@ -122,21 +123,21 @@ paramOrder: 'param1|param2|param'
             method,
             i = 0,
             len;
-            
+
         //&lt;debug&gt;
         if (!fn) {
             Ext.Error.raise('No direct function specified for this proxy');
         }
         //&lt;/debug&gt;
-            
+
         if (operation.allowWrite()) {
             request = writer.write(request);
         }
-        
+
         if (operation.action == 'read') {
             // We need to pass params
             method = fn.directCfg.method;
-            
+
             if (method.ordered) {
                 if (method.len &gt; 0) {
                     if (paramOrder) {
@@ -153,7 +154,7 @@ paramOrder: 'param1|param2|param'
         } else {
             args.push(request.jsonData);
         }
-        
+
         Ext.apply(request, {
             args: args,
             directFn: fn
@@ -161,7 +162,7 @@ paramOrder: 'param1|param2|param'
         args.push(me.createRequestCallback(request, operation, callback, scope), me);
         fn.apply(window, args);
     },
-    
+
     /*
      * Inherit docs. We don't apply any encoding here because
      * all of the direct requests go out as jsonData
@@ -169,25 +170,25 @@ paramOrder: 'param1|param2|param'
     applyEncoding: function(value){
         return value;
     },
-    
+
     createRequestCallback: function(request, operation, callback, scope){
         var me = this;
-        
+
         return function(data, event){
             me.processResponse(event.status, operation, request, event, callback, scope);
         };
     },
-    
+
     // inherit docs
     extractResponseData: function(response){
         return Ext.isDefined(response.result) ? response.result : response.data;
     },
-    
+
     // inherit docs
     setException: function(operation, response) {
         operation.setException(response.message);
     },
-    
+
     // inherit docs
     buildUrl: function(){
         return '';