Upgrade to ExtJS 3.3.1 - Released 11/30/2010
[extjs.git] / docs / output / Ext.form.Action.DirectLoad.html
index 102f81d..c1f5261 100644 (file)
@@ -1,43 +1,69 @@
-<div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.form.Action.DirectLoad-props"><img src="resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectLoad-methods"><img src="resources/images/default/s.gif" class="item-icon icon-method">Methods</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectLoad-events"><img src="resources/images/default/s.gif" class="item-icon icon-event">Events</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectLoad-configs"><img src="resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>&#13;<a class="bookmark" href="../docs/?class=Ext.form.Action.DirectLoad"><img src="resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>&#13;</div><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.form.Action.html" ext:member="" ext:cls="Ext.form.Action">Action</a>&#13;&nbsp;&nbsp;<img src="resources/elbow-end.gif"><a href="output/Ext.form.Action.Load.html" ext:member="" ext:cls="Ext.form.Action.Load">Action.Load</a>&#13;&nbsp;&nbsp;&nbsp;&nbsp;<img src="resources/elbow-end.gif">Action.DirectLoad</pre></div><h1>Class <a href="source/Action.html#cls-Ext.form.Action.DirectLoad">Ext.form.Action.DirectLoad</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.form</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">Action.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Action.html#cls-Ext.form.Action.DirectLoad">Action.DirectLoad</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.form.Action.Load.html" ext:cls="Ext.form.Action.Load" ext:member="">Action.Load</a></td></tr></table><div class="description">Provides Ext.direct support for loading form data. This example illustrates usage
-of Ext.Direct to load a submit a form through Ext.Direct.
+<div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.form.Action.DirectLoad-props"><img src="resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectLoad-methods"><img src="resources/images/default/s.gif" class="item-icon icon-method">Methods</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectLoad-events"><img src="resources/images/default/s.gif" class="item-icon icon-event">Events</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectLoad-configs"><img src="resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>&#13;<a class="bookmark" href="../docs/?class=Ext.form.Action.DirectLoad"><img src="resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>&#13;</div><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.form.Action.html" ext:member="" ext:cls="Ext.form.Action">Action</a>
+  <img src="resources/elbow-end.gif"><a href="output/Ext.form.Action.Load.html" ext:member="" ext:cls="Ext.form.Action.Load">Action.Load</a>
+    <img src="resources/elbow-end.gif">Action.DirectLoad</pre></div><h1>Class <a href="source/Action.html#cls-Ext.form.Action.DirectLoad">Ext.form.Action.DirectLoad</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.form</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/Action.html#cls-Ext.form.Action.DirectLoad">Action.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Action.html#cls-Ext.form.Action.DirectLoad">Action.DirectLoad</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.form.Action.Load.html" ext:cls="Ext.form.Action.Load" ext:member="">Action.Load</a></td></tr></table><div class="description"><p>Provides Ext.direct support for loading form data.</p>
+<p>This example illustrates usage of Ext.Direct to <b>load</b> a form through Ext.Direct.</p>
 <pre><code><b>var</b> myFormPanel = <b>new</b> Ext.form.FormPanel({
     <i>// configs <b>for</b> FormPanel</i>
     title: <em>'Basic Information'</em>,
-    border: false,
+    renderTo: document.body,
+    width: 300, height: 160,
     padding: 10,
-    buttons:[{
-        text: <em>'Submit'</em>,
-        handler: <b>function</b>(){
-            basicInfo.getForm().submit({
-                params: {
-                    uid: 5
-                }
-            });
-        }
-    }],
-    
+
     <i>// configs apply to child items</i>
     defaults: {anchor: <em>'100%'</em>},
     defaultType: <em>'textfield'</em>,
-    items: [
-        <i>// form fields go here</i>
-    ],
-    
+    items: [{
+        fieldLabel: <em>'Name'</em>,
+        name: <em>'name'</em>
+    },{
+        fieldLabel: <em>'Email'</em>,
+        name: <em>'email'</em>
+    },{
+        fieldLabel: <em>'Company'</em>,
+        name: <em>'company'</em>
+    }],
+
     <i>// configs <b>for</b> BasicForm</i>
     api: {
+        <i>// The server-side method to call <b>for</b> load() requests</i>
         load: Profile.getBasicInfo,
         <i>// The server-side must mark the submit handler as a <em>'formHandler'</em></i>
         submit: Profile.updateBasicInfo
-    },    
-    paramOrder: [<em>'uid'</em>]
+    },
+    <i>// specify the order <b>for</b> the passed params</i>
+    paramOrder: [<em>'uid'</em>, <em>'foo'</em>]
 });
 
 <i>// load the form</i>
 myFormPanel.getForm().load({
+    <i>// pass 2 arguments to server side getBasicInfo method (len=2)</i>
     params: {
-        uid: 5
+        foo: <em>'bar'</em>,
+        uid: 34
+    }
+});</code></pre>
+The data packet sent to the server will resemble something like:
+<pre><code>[
+    {
+        <em>"action"</em>:<em>"Profile"</em>,<em>"method"</em>:<em>"getBasicInfo"</em>,<em>"type"</em>:<em>"rpc"</em>,<em>"tid"</em>:2,
+        <em>"data"</em>:[34,<em>"bar"</em>] <i>// note the order of the params</i>
+    }
+]</code></pre>
+The form will process a data packet returned by the server that is similar
+to the following format:
+<pre><code>[
+    {
+        <em>"action"</em>:<em>"Profile"</em>,<em>"method"</em>:<em>"getBasicInfo"</em>,<em>"type"</em>:<em>"rpc"</em>,<em>"tid"</em>:2,
+        <em>"result"</em>:{
+            <em>"success"</em>:true,
+            <em>"data"</em>:{
+                <em>"name"</em>:<em>"Fred Flintstone"</em>,
+                <em>"company"</em>:<em>"Slate Rock and Gravel"</em>,
+                <em>"email"</em>:<em>"fred.flintstone@slaterg.com"</em>
+            }
+        }
     }
-});</code></pre></div><div class="hr"></div><a id="Ext.form.Action.DirectLoad-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-failure"></a><b><a href="source/Action.html#cfg-Ext.form.Action-failure">failure</a></b> : Function<div class="mdesc"><div class="short">The function to call when a failure packet was recieved, or when an
+]</code></pre></div><div class="hr"></div><a id="Ext.form.Action.DirectLoad-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-failure"></a><b><a href="source/Action.html#cfg-Ext.form.Action-failure">failure</a></b> : Function<div class="mdesc"><div class="short">The function to call when a failure packet was recieved, or when an
 error ocurred in the Ajax communication.
 The func...</div><div class="long">The function to call when a failure packet was recieved, or when an
 error ocurred in the Ajax communication.
@@ -58,7 +84,8 @@ before the success callba...</div><div class="long">When set to <tt><b>true</b><
 <a href="output/Ext.form.BasicForm.reset.html" ext:cls="Ext.form.BasicForm.reset">reset</a> on Action success. If specified, this happens
 <b>before</b> the <a href="output/Ext.form.Action.html#Ext.form.Action-success" ext:member="success" ext:cls="Ext.form.Action">success</a> callback is called and before the Form's
 <a href="output/Ext.form.BasicForm.actioncomplete.html" ext:cls="Ext.form.BasicForm.actioncomplete">actioncomplete</a> event fires.</div></div></td><td class="msource"><a href="output/Ext.form.Action.html#reset" ext:member="#reset" ext:cls="Ext.form.Action">Action</a></td></tr><tr class="config-row  inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-scope"></a><b><a href="source/Action.html#cfg-Ext.form.Action-scope">scope</a></b> : Object<div class="mdesc">The scope in which to call the callback functions (The <tt>this</tt> reference
-for the callback functions).</div></td><td class="msource"><a href="output/Ext.form.Action.html#scope" ext:member="#scope" ext:cls="Ext.form.Action">Action</a></td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-success"></a><b><a href="source/Action.html#cfg-Ext.form.Action-success">success</a></b> : Function<div class="mdesc"><div class="short">The function to call when a valid success return packet is recieved.
+for the callback functions).</div></td><td class="msource"><a href="output/Ext.form.Action.html#scope" ext:member="#scope" ext:cls="Ext.form.Action">Action</a></td></tr><tr class="config-row  inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-submitEmptyText"></a><b><a href="source/Action.html#cfg-Ext.form.Action-submitEmptyText">submitEmptyText</a></b> : Boolean<div class="mdesc">If set to <tt>true</tt>, the emptyText value will be sent with the form
+when it is submitted.  Defaults to <tt>true</tt>.</div></td><td class="msource"><a href="output/Ext.form.Action.html#submitEmptyText" ext:member="#submitEmptyText" ext:cls="Ext.form.Action">Action</a></td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-success"></a><b><a href="source/Action.html#cfg-Ext.form.Action-success">success</a></b> : Function<div class="mdesc"><div class="short">The function to call when a valid success return packet is recieved.
 The function is passed the following parameters:...</div><div class="long">The function to call when a valid success return packet is recieved.
 The function is passed the following parameters:<ul class="mdetail-params">
 <li><b>form</b> : Ext.form.BasicForm<div class="sub-desc">The form that requested the action</div></li>