Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/Field.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-Field-method-constructor'><span id='Ext-form-Field'>/**
</span></span> * @class Ext.form.Field
* @extends Ext.BoxComponent
* Base class for form fields that provides default event handling, sizing, value handling and other functionality.
* @constructor
* Creates a new Field
* @param {Object} config Configuration options
* @xtype field
*/
Ext.form.Field = Ext.extend(Ext.BoxComponent, {
<span id='Ext-form-Field-property-label'> /**
</span> * <p>The label Element associated with this Field. <b>Only available after this Field has been rendered by a
* {@link form Ext.layout.FormLayout} layout manager.</b></p>
* @type Ext.Element
* @property label
*/
<span id='Ext-form-Field-cfg-inputType'> /**
</span> * @cfg {String} inputType The type attribute for input fields -- e.g. radio, text, password, file (defaults
* to 'text'). The types 'file' and 'password' must be used to render those field types currently -- there are
* no separate Ext components for those. Note that if you use <tt>inputType:'file'</tt>, {@link #emptyText}
* is not supported and should be avoided.
*/
<span id='Ext-form-Field-cfg-tabIndex'> /**
</span> * @cfg {Number} tabIndex The tabIndex for this field. Note this only applies to fields that are rendered,
* not those which are built via applyTo (defaults to undefined).
*/
<span id='Ext-form-Field-cfg-value'> /**
</span> * @cfg {Mixed} value A value to initialize this field with (defaults to undefined).
*/
<span id='Ext-form-Field-cfg-name'> /**
</span> * @cfg {String} name The field's HTML name attribute (defaults to '').
* <b>Note</b>: this property must be set if this field is to be automatically included with
* {@link Ext.form.BasicForm#submit form submit()}.
*/
<span id='Ext-form-Field-cfg-cls'> /**
</span> * @cfg {String} cls A custom CSS class to apply to the field's underlying element (defaults to '').
*/
<span id='Ext-form-Field-cfg-invalidClass'> /**
</span> * @cfg {String} invalidClass The CSS class to use when marking a field invalid (defaults to 'x-form-invalid')
*/
invalidClass : 'x-form-invalid',
<span id='Ext-form-Field-cfg-invalidText'> /**
</span> * @cfg {String} invalidText The error text to use when marking a field invalid and no message is provided
* (defaults to 'The value in this field is invalid')
*/
invalidText : 'The value in this field is invalid',
<span id='Ext-form-Field-cfg-focusClass'> /**
</span> * @cfg {String} focusClass The CSS class to use when the field receives focus (defaults to 'x-form-focus')
*/
focusClass : 'x-form-focus',
<span id='Ext-form-Field-cfg-preventMark'> /**
</span> * @cfg {Boolean} preventMark
* <tt>true</tt> to disable {@link #markInvalid marking the field invalid}.
* Defaults to <tt>false</tt>.
*/
<span id='Ext-form-Field-cfg-validationEvent'> /**
</span> * @cfg {String/Boolean} validationEvent The event that should initiate field validation. Set to false to disable
automatic validation (defaults to 'keyup').
*/
validationEvent : 'keyup',
<span id='Ext-form-Field-cfg-validateOnBlur'> /**
</span> * @cfg {Boolean} validateOnBlur Whether the field should validate when it loses focus (defaults to true).
*/
validateOnBlur : true,
<span id='Ext-form-Field-cfg-validationDelay'> /**
</span> * @cfg {Number} validationDelay The length of time in milliseconds after user input begins until validation
* is initiated (defaults to 250)
*/
validationDelay : 250,
<span id='Ext-form-Field-cfg-autoCreate'> /**
</span> * @cfg {String/Object} autoCreate <p>A {@link Ext.DomHelper DomHelper} element spec, or true for a default
* element spec. Used to create the {@link Ext.Component#getEl Element} which will encapsulate this Component.
* See <tt>{@link Ext.Component#autoEl autoEl}</tt> for details. Defaults to:</p>
* <pre><code>{tag: 'input', type: 'text', size: '20', autocomplete: 'off'}</code></pre>
*/
defaultAutoCreate : {tag: 'input', type: 'text', size: '20', autocomplete: 'off'},
<span id='Ext-form-Field-cfg-fieldClass'> /**
</span> * @cfg {String} fieldClass The default CSS class for the field (defaults to 'x-form-field')
share/docs/source/Field.html view on Meta::CPAN
],
...
});
* </code></pre>
* @param {Ext.form.Field} this
* @param {Ext.EventObject} e The event object
*/
'specialkey',
<span id='Ext-form-Field-event-change'> /**
</span> * @event change
* Fires just before the field blurs if the field value has changed.
* @param {Ext.form.Field} this
* @param {Mixed} newValue The new value
* @param {Mixed} oldValue The original value
*/
'change',
<span id='Ext-form-Field-event-invalid'> /**
</span> * @event invalid
* Fires after the field has been marked as invalid.
* @param {Ext.form.Field} this
* @param {String} msg The validation message
*/
'invalid',
<span id='Ext-form-Field-event-valid'> /**
</span> * @event valid
* Fires after the field has been validated with no errors.
* @param {Ext.form.Field} this
*/
'valid'
);
},
<span id='Ext-form-Field-method-getName'> /**
</span> * Returns the {@link Ext.form.Field#name name} or {@link Ext.form.ComboBox#hiddenName hiddenName}
* attribute of the field if available.
* @return {String} name The field {@link Ext.form.Field#name name} or {@link Ext.form.ComboBox#hiddenName hiddenName}
*/
getName : function(){
return this.rendered && this.el.dom.name ? this.el.dom.name : this.name || this.id || '';
},
<span id='Ext-form-Field-method-onRender'> // private
</span> onRender : function(ct, position){
if(!this.el){
var cfg = this.getAutoCreate();
if(!cfg.name){
cfg.name = this.name || this.id;
}
if(this.inputType){
cfg.type = this.inputType;
}
this.autoEl = cfg;
}
Ext.form.Field.superclass.onRender.call(this, ct, position);
if(this.submitValue === false){
this.el.dom.removeAttribute('name');
}
var type = this.el.dom.type;
if(type){
if(type == 'password'){
type = 'text';
}
this.el.addClass('x-form-'+type);
}
if(this.readOnly){
this.setReadOnly(true);
}
if(this.tabIndex !== undefined){
this.el.dom.setAttribute('tabIndex', this.tabIndex);
}
this.el.addClass([this.fieldClass, this.cls]);
},
<span id='Ext-form-Field-method-getItemCt'> // private
</span> getItemCt : function(){
return this.itemCt;
},
<span id='Ext-form-Field-method-initValue'> // private
</span> initValue : function(){
if(this.value !== undefined){
this.setValue(this.value);
}else if(!Ext.isEmpty(this.el.dom.value) && this.el.dom.value != this.emptyText){
this.setValue(this.el.dom.value);
}
<span id='Ext-form-Field-property-originalValue'> /**
</span> * The original value of the field as configured in the {@link #value} configuration, or
* as loaded by the last form load operation if the form's {@link Ext.form.BasicForm#trackResetOnLoad trackResetOnLoad}
* setting is <code>true</code>.
* @type mixed
* @property originalValue
*/
this.originalValue = this.getValue();
},
<span id='Ext-form-Field-method-isDirty'> /**
</span> * <p>Returns true if the value of this Field has been changed from its original value.
* Will return false if the field is disabled or has not been rendered yet.</p>
* <p>Note that if the owning {@link Ext.form.BasicForm form} was configured with
* {@link Ext.form.BasicForm}.{@link Ext.form.BasicForm#trackResetOnLoad trackResetOnLoad}
* then the <i>original value</i> is updated when the values are loaded by
* {@link Ext.form.BasicForm}.{@link Ext.form.BasicForm#setValues setValues}.</p>
* @return {Boolean} True if this field has been changed from its original value (and
* is not disabled), false otherwise.
*/
isDirty : function() {
if(this.disabled || !this.rendered) {
return false;
}
return String(this.getValue()) !== String(this.originalValue);
},
<span id='Ext-form-Field-method-setReadOnly'> /**
</span> * Sets the read only state of this field.
* @param {Boolean} readOnly Whether the field should be read only.
*/
setReadOnly : function(readOnly){
if(this.rendered){
this.el.dom.readOnly = readOnly;
( run in 0.649 second using v1.01-cache-2.11-cpan-5623c5533a1 )