Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/BasicForm.html view on Meta::CPAN
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<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>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='Ext-form-BasicForm-method-constructor'><span id='Ext-form-BasicForm'>/**
</span></span> * @class Ext.form.BasicForm
* @extends Ext.util.Observable
* <p>Encapsulates the DOM &lt;form> element at the heart of the {@link Ext.form.FormPanel FormPanel} class, and provides
* input field management, validation, submission, and form loading services.</p>
* <p>By default, Ext Forms are submitted through Ajax, using an instance of {@link Ext.form.Action.Submit}.
* To enable normal browser submission of an Ext Form, use the {@link #standardSubmit} config option.</p>
* <p><b><u>File Uploads</u></b></p>
* <p>{@link #fileUpload File uploads} are not performed using Ajax submission, that
* is they are <b>not</b> performed using XMLHttpRequests. Instead the form is submitted in the standard
* manner with the DOM <tt>&lt;form></tt> element temporarily modified to have its
* <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
* to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
* but removed after the return data has been gathered.</p>
* <p>The server response is parsed by the browser to create the document for the IFRAME. If the
* server is using JSON to send the return object, then the
* <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
* must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
* <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
* "&lt;" as "&amp;lt;", "&amp;" as "&amp;amp;" etc.</p>
* <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
* is created containing a <tt>responseText</tt> property in order to conform to the
* requirements of event handlers and callbacks.</p>
* <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
* and some server technologies (notably JEE) may require some custom processing in order to
* retrieve parameter names and parameter values from the packet content.</p>
* @constructor
* @param {Mixed} el The form element or its id
* @param {Object} config Configuration options
*/
Ext.form.BasicForm = Ext.extend(Ext.util.Observable, {
constructor: function(el, config){
Ext.apply(this, config);
if(Ext.isString(this.paramOrder)){
this.paramOrder = this.paramOrder.split(/[\s,|]/);
}
<span id='Ext-form-BasicForm-property-items'> /**
</span> * A {@link Ext.util.MixedCollection MixedCollection} containing all the Ext.form.Fields in this form.
* @type MixedCollection
* @property items
*/
this.items = new Ext.util.MixedCollection(false, function(o){
return o.getItemId();
});
this.addEvents(
<span id='Ext-form-BasicForm-event-beforeaction'> /**
</span> * @event beforeaction
* Fires before any action is performed. Return false to cancel the action.
* @param {Form} this
* @param {Action} action The {@link Ext.form.Action} to be performed
*/
'beforeaction',
<span id='Ext-form-BasicForm-event-actionfailed'> /**
</span> * @event actionfailed
* Fires when an action fails.
* @param {Form} this
* @param {Action} action The {@link Ext.form.Action} that failed
*/
'actionfailed',
<span id='Ext-form-BasicForm-event-actioncomplete'> /**
</span> * @event actioncomplete
* Fires when an action is completed.
* @param {Form} this
* @param {Action} action The {@link Ext.form.Action} that completed
*/
'actioncomplete'
);
if(el){
this.initEl(el);
}
Ext.form.BasicForm.superclass.constructor.call(this);
},
<span id='Ext-form-BasicForm-cfg-method'> /**
</span> * @cfg {String} method
* The request method to use (GET or POST) for form actions if one isn't supplied in the action options.
*/
<span id='Ext-form-BasicForm-cfg-reader'> /**
</span> * @cfg {DataReader} reader
* An Ext.data.DataReader (e.g. {@link Ext.data.XmlReader}) to be used to read
* data when executing 'load' actions. This is optional as there is built-in
* support for processing JSON. For additional information on using an XMLReader
* see the example provided in examples/form/xml-form.html.
*/
<span id='Ext-form-BasicForm-cfg-errorReader'> /**
</span> * @cfg {DataReader} errorReader
* <p>An Ext.data.DataReader (e.g. {@link Ext.data.XmlReader}) to be used to
* read field error messages returned from 'submit' actions. This is optional
* as there is built-in support for processing JSON.</p>
* <p>The Records which provide messages for the invalid Fields must use the
* Field name (or id) as the Record ID, and must contain a field called 'msg'
* which contains the error message.</p>
* <p>The errorReader does not have to be a full-blown implementation of a
* DataReader. It simply needs to implement a <tt>read(xhr)</tt> function
* which returns an Array of Records in an object with the following
* structure:</p><pre><code>
{
records: recordArray
}
</code></pre>
*/
<span id='Ext-form-BasicForm-cfg-url'> /**
</span> * @cfg {String} url
* The URL to use for form actions if one isn't supplied in the
* <code>{@link #doAction doAction} options</code>.
*/
<span id='Ext-form-BasicForm-cfg-fileUpload'> /**
</span> * @cfg {Boolean} fileUpload
* Set to true if this form is a file upload.
* <p>File uploads are not performed using normal 'Ajax' techniques, that is they are <b>not</b>
* performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
* DOM <tt>&lt;form></tt> element temporarily modified to have its
* <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
* to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
* but removed after the return data has been gathered.</p>
* <p>The server response is parsed by the browser to create the document for the IFRAME. If the
* server is using JSON to send the return object, then the
* <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
* must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
* <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
* "&lt;" as "&amp;lt;", "&amp;" as "&amp;amp;" etc.</p>
* <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
* is created containing a <tt>responseText</tt> property in order to conform to the
* requirements of event handlers and callbacks.</p>
* <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
* and some server technologies (notably JEE) may require some custom processing in order to
* retrieve parameter names and parameter values from the packet content.</p>
*/
<span id='Ext-form-BasicForm-cfg-baseParams'> /**
</span> * @cfg {Object} baseParams
* <p>Parameters to pass with all requests. e.g. baseParams: {id: '123', foo: 'bar'}.</p>
* <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p>
*/
<span id='Ext-form-BasicForm-cfg-timeout'> /**
</span> * @cfg {Number} timeout Timeout for form actions in seconds (default is 30 seconds).
*/
timeout: 30,
<span id='Ext-form-BasicForm-cfg-api'> /**
</span> * @cfg {Object} api (Optional) If specified load and submit actions will be handled
* with {@link Ext.form.Action.DirectLoad} and {@link Ext.form.Action.DirectSubmit}.
* Methods which have been imported by Ext.Direct can be specified here to load and submit
* forms.
* Such as the following:<pre><code>
api: {
load: App.ss.MyProfile.load,
submit: App.ss.MyProfile.submit
}
</code></pre>
* <p>Load actions can use <code>{@link #paramOrder}</code> or <code>{@link #paramsAsHash}</code>
* to customize how the load method is invoked.
* Submit actions will always use a standard form submit. The formHandler configuration must
* be set on the associated server-side method which has been imported by Ext.Direct</p>
*/
<span id='Ext-form-BasicForm-cfg-paramOrder'> /**
</span> * @cfg {Array/String} paramOrder <p>A list of params to be executed server side.
* Defaults to <tt>undefined</tt>. Only used for the <code>{@link #api}</code>
* <code>load</code> configuration.</p>
* <br><p>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:</p><pre><code>
paramOrder: ['param1','param2','param3']
paramOrder: 'param1 param2 param3'
paramOrder: 'param1,param2,param3'
paramOrder: 'param1|param2|param'
</code></pre>
*/
paramOrder: undefined,
<span id='Ext-form-BasicForm-cfg-paramsAsHash'> /**
</span> * @cfg {Boolean} paramsAsHash Only used for the <code>{@link #api}</code>
* <code>load</code> configuration. Send parameters as a collection of named
* arguments (defaults to <tt>false</tt>). Providing a
* <tt>{@link #paramOrder}</tt> nullifies this configuration.
*/
paramsAsHash: false,
<span id='Ext-form-BasicForm-cfg-waitTitle'> /**
</span> * @cfg {String} waitTitle
* The default title to show for the waiting message box (defaults to <tt>'Please Wait...'</tt>)
*/
waitTitle: 'Please Wait...',
( run in 0.995 second using v1.01-cache-2.11-cpan-62a16548d74 )