-<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> <a class="inner-link" href="#Ext.form.Action.DirectLoad-methods"><img src="resources/images/default/s.gif" class="item-icon icon-method">Methods</a> <a class="inner-link" href="#Ext.form.Action.DirectLoad-events"><img src="resources/images/default/s.gif" class="item-icon icon-event">Events</a> <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> <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> </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">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 xmlns:ext="http://www.extjs.com" class="body-wrap"><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">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"><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"> </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"> </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.