X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/docs/output/Ext.form.TimeField.html diff --git a/docs/output/Ext.form.TimeField.html b/docs/output/Ext.form.TimeField.html index d4f5e565..fb65bb8b 100644 --- a/docs/output/Ext.form.TimeField.html +++ b/docs/output/Ext.form.TimeField.html @@ -1,13 +1,20 @@ -
Package: | Ext.form |
Defined In: | TimeField.js |
Class: | TimeField |
Extends: | ComboBox |
new Ext.form.TimeField({
- minValue: '9:00 AM',
- maxValue: '6:00 PM',
- increment: 30
+Observable
+ Component
+ BoxComponent
+ Field
+ TextField
+ TriggerField
+ ComboBox
+ TimeField
Class Ext.form.TimeField
Package: Ext.form Defined In: TimeField.js Class: TimeField Extends: ComboBox
Provides a time input field with a time dropdown and automatic time validation. Example usage:
+new Ext.form.TimeField({
+ minValue: '9:00 AM',
+ maxValue: '6:00 PM',
+ increment: 30
});
Config Options
Config Options Defined By allQuery : StringThe text query to send to the server to return all records for the list
with no filtering (defaults to '') ComboBox allowBlank : BooleanSpecify false to validate that the value's length is > 0 (defaults to
-true) TextField allowDomMove : BooleanWhether the component can move the Dom node when rendering (defaults to true). Component altFormats : StringMultiple date formats separated by "|" to try when parsing a user input value and it doesn't match the defined
-forma...Multiple date formats separated by "|" to try when parsing a user input value and it doesn't match the defined
-format (defaults to 'g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H'). TimeField anchor : StringNote: this config is only used when this Component is rendered
+true) TextField allowDomMove : BooleanWhether the component can move the Dom node when rendering (defaults to true). Component altFormats : StringMultiple date formats separated by "|" to try when parsing a user input value and it doesn't match the defined
+format...Multiple date formats separated by "|" to try when parsing a user input value and it doesn't match the defined
+format (defaults to 'g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A'). TimeField anchor : StringNote: this config is only used when this Component is rendered
by a Container which has been configured to use an Anc...Note: this config is only used when this Component is rendered
by a Container which has been configured to use an AnchorLayout (or subclass thereof).
based layout manager, for example:
@@ -139,7 +146,10 @@ Warning: This will override any size manag...
The maxi
Warning: This will override any size mana...
The minimum value in pixels which this BoxComponent will set its height to.
Warning: This will override any size management applied by layout managers.
BoxComponent boxMinWidth : NumberThe minimum value in pixels which this BoxComponent will set its width to.
Warning: This will override any size manag...The minimum value in pixels which this BoxComponent will set its width to.
-Warning: This will override any size management applied by layout managers.
BoxComponent clearCls : StringThe CSS class used to to apply to the special clearing div rendered
+Warning: This will override any size management applied by layout managers.
BoxComponent bubbleEvents : ArrayAn array of events that, when fired, should be bubbled to any parent container.
+See Ext.util.Observable.enableBubble....An array of events that, when fired, should be bubbled to any parent container.
+See Ext.util.Observable.enableBubble.
+Defaults to [].
Component clearCls : StringThe CSS class used to to apply to the special clearing div rendered
directly after each form field wrapper to provide...The CSS class used to to apply to the special clearing div rendered
directly after each form field wrapper to provide field clearing (defaults to
'x-form-clear-left').
@@ -218,25 +228,23 @@ or horizontally (by an HBoxLayout) according to the item's relative flex value specified. Any child items that have
either a flex = 0
or flex = undefined
will not be 'flexed' (the initial size will not be changed).
BoxComponent focusClass : StringThe CSS class to use when the field receives focus (defaults to 'x-form-focus') Field forceSelection : Booleantrue to restrict the selected value to one of the values in the list,
false to allow the user to set arbitrary text i...true to restrict the selected value to one of the values in the list,
-false to allow the user to set arbitrary text into the field (defaults to false) ComboBox format : StringThe default time format string which can be overriden for localization support. The format must be
-valid according ...The default time format string which can be overriden for localization support. The format must be
-valid according to Date.parseDate (defaults to 'g:i A', e.g., '3:15 PM'). For 24-hour time
-format try 'H:i' instead. TimeField handleHeight : NumberThe height in pixels of the dropdown list resize handle if
+false to allow the user to set arbitrary text into the field (defaults to false) ComboBox format : StringThe default time format string which can be overriden for localization support. The format must be
+valid according t...The default time format string which can be overriden for localization support. The format must be
+valid according to Date.parseDate (defaults to 'g:i A', e.g., '3:15 PM'). For 24-hour time
+format try 'H:i' instead. TimeField grow : Booleantrue if this field should automatically grow and shrink to its content
+(defaults to false) TextField growMax : NumberThe maximum width to allow when grow = true
(defaults
+to 800) TextField growMin : NumberThe minimum width to allow when grow = true
(defaults
+to 30) TextField handleHeight : NumberThe height in pixels of the dropdown list resize handle if
resizable = true (defaults to 8) ComboBox height : NumberThe height of this component in pixels (defaults to auto).
Note to express this dimension as a percentage or offset s...The height of this component in pixels (defaults to auto).
Note to express this dimension as a percentage or offset see Ext.Component.anchor. BoxComponent hidden : BooleanRender this component hidden (default is false). If true, the
hide method will be called internally. Component hiddenId : StringIf hiddenName is specified, hiddenId can also be provided
-to give the hidden field a unique id (defaults to the hidde...If hiddenName is specified, hiddenId can also be provided
-to give the hidden field a unique id (defaults to the hiddenName). The hiddenId
-and combo id should be different, since no two DOM
-nodes should share the same id. ComboBox hiddenName : StringIf specified, a hidden form field with this name is dynamically generated to store the
+to give the hidden field a unique id. The hiddenId and com...If hiddenName is specified, hiddenId can also be provided
+to give the hidden field a unique id. The hiddenId and combo id should be
+different, since no two DOM nodes should share the same id. ComboBox hiddenName : StringIf specified, a hidden form field with this name is dynamically generated to store the
field's data value (defaults t...If specified, a hidden form field with this name is dynamically generated to store the
field's data value (defaults to the underlying DOM element's name). Required for the combo's value to automatically
-post during a form submission. See also valueField.
-Note: the hidden field's id will also default to this name if hiddenId is not specified.
-The ComboBox id and the hiddenId should be different, since
-no two DOM nodes should share the same id. So, if the ComboBox name and
-hiddenName are the same, you should specify a unique hiddenId.
ComboBox hiddenValue : StringSets the initial value of the hidden field if hiddenName is
+post during a form submission. See also valueField. ComboBox hiddenValue : StringSets the initial value of the hidden field if hiddenName is
specified to contain the selected valueField, from the St...Sets the initial value of the hidden field if hiddenName is
specified to contain the selected valueField, from the Store. Defaults to the configured
value. ComboBox hideLabel : Booleantrue to completely hide the label element
@@ -282,7 +290,7 @@ sub-elements using this component's id as the parent.
to 'text'). The types 'file' and 'p...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 inputType:'file', emptyText
-is not supported and should be avoided. Field invalidClass : StringThe CSS class to use when marking a field invalid (defaults to 'x-form-invalid') Field invalidText : StringThe error text to display when the time in the field is invalid (defaults to
+is not supported and should be avoided. Field invalidClass : StringThe CSS class to use when marking a field invalid (defaults to 'x-form-invalid') Field invalidText : StringThe error text to display when the time in the field is invalid (defaults to
'{value} is not a valid time'). TimeField itemCls : StringNote: this config is only used when this Component is rendered by a Container which
has been configured to use the Fo...Note: this config is only used when this Component is rendered by a Container which
has been configured to use the FormLayout layout manager (e.g.
@@ -496,10 +504,10 @@ any attributes you want to a field, for example:
var myField =
autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '10'}
});
TextField maxLengthText : StringError text to display if the maximum length
validation fails (defaults to 'The maximum length for this field is {maxL...Error text to display if the maximum length
-validation fails (defaults to 'The maximum length for this field is {maxLength}') TextField maxText : StringThe error text to display when the time is after maxValue (defaults to
-'The time in this field must be equal to or b...The error text to display when the time is after maxValue (defaults to
-'The time in this field must be equal to or before {0}'). TimeField maxValue : Date/StringThe maximum allowed time. Can be either a Javascript date object with a valid time value or a string
-time in a vali...The maximum allowed time. Can be either a Javascript date object with a valid time value or a string
+validation fails (defaults to 'The maximum length for this field is {maxLength}') TextField maxText : StringThe error text to display when the time is after maxValue (defaults to
+'The time in this field must be equal to or be...The error text to display when the time is after maxValue (defaults to
+'The time in this field must be equal to or before {0}'). TimeField maxValue : Date/StringThe maximum allowed time. Can be either a Javascript date object with a valid time value or a string
+time in a valid ...The maximum allowed time. Can be either a Javascript date object with a valid time value or a string
time in a valid format -- see format and altFormats (defaults to undefined). TimeField minChars : NumberThe minimum number of characters the user must type before autocomplete and
typeAhead activate (defaults to 4 if mode...The minimum number of characters the user must type before autocomplete and
typeAhead activate (defaults to 4 if mode = 'remote' or 0 if
@@ -509,10 +517,10 @@ distance to the viewport edges ...The minimum height in
distance to the viewport edges (defaults to 90) ComboBox minLength : NumberMinimum input field length required (defaults to 0) TextField minLengthText : StringError text to display if the minimum length
validation fails (defaults to 'The minimum length for this field is {minL...Error text to display if the minimum length
validation fails (defaults to 'The minimum length for this field is {minLength}') TextField minListWidth : NumberThe minimum width of the dropdown list in pixels (defaults to 70, will
-be ignored if listWidth has a higher value) ComboBox minText : StringThe error text to display when the date in the cell is before minValue (defaults to
-'The time in this field must be ...The error text to display when the date in the cell is before minValue (defaults to
-'The time in this field must be equal to or after {0}'). TimeField minValue : Date/StringThe minimum allowed time. Can be either a Javascript date object with a valid time value or a string
-time in a vali...The minimum allowed time. Can be either a Javascript date object with a valid time value or a string
+be ignored if listWidth has a higher value) ComboBox minText : StringThe error text to display when the date in the cell is before minValue (defaults to
+'The time in this field must be e...The error text to display when the date in the cell is before minValue (defaults to
+'The time in this field must be equal to or after {0}'). TimeField minValue : Date/StringThe minimum allowed time. Can be either a Javascript date object with a valid time value or a string
+time in a valid ...The minimum allowed time. Can be either a Javascript date object with a valid time value or a string
time in a valid format -- see format and altFormats (defaults to undefined). TimeField mode : StringAcceptable values are:
<div class="mdetail-params">
'remote' : Default
@@ -541,9 +549,9 @@ clicked, set to 'local' and manually load the store. To force a requer
triggerAction: 'all'
});
ComboBox msgFx : StringExperimental The effect used when displaying a validation message under the field
-(defaults to 'normal'). Field msgTarget<p>The : Stringlocation where the message text set through markInvalid should display.
+(defaults to 'normal'). Field msgTarget : StringThe location where the message text set through markInvalid should display.
Must be one of the following values:
-<div cla...location where the message text set through markInvalid should display.
+<div...The location where the message text set through markInvalid should display.
Must be one of the following values:
qtip
Display a quick tip containing the message when the user hovers over the field. This is the default.
@@ -552,7 +560,7 @@ Must be one of the following values:
under
Add a block div beneath the field containing the error message.
side
Add an error icon to the right of the field, displaying the message in a popup on hover.
[element id]
Add the error message directly to the innerHTML of the specified element.
-
Field name : StringThe field's HTML name attribute (defaults to '').
+ Field name : StringThe field's HTML name attribute (defaults to '').
Note: this property must be set if this field is to be automaticall...The field's HTML name attribute (defaults to '').
Note: this property must be set if this field is to be automatically included with
form submit(). Field overCls : StringAn optional extra CSS class that will be added to this component's Element when the mouse moves
@@ -842,7 +850,20 @@ config for a suggestion, or use a render listener directly:new
single: true // Remove the listener after first invocation
}
});
-See also getEl
Component hidden : BooleanTrue if this component is hidden. Read-only. Component initialConfig : ObjectThis Component's initial configuration specification. Read-only. Component label : Ext.ElementThe label Element associated with this Field. Only available after this Field has been rendered by a
+See also getEl
Component hidden : BooleanTrue if this component is hidden. Read-only. Component initialConfig : ObjectThis Component's initial configuration specification. Read-only. Component keyNav : Ext.KeyNav
+<p>A {@link Ext.KeyNav KeyNav} object which handles navigation keys for this ComboBox. This performs actions
+based on keystrokes typed when the input field is focused.</p>
+<p><b>After the ComboBox has been rendered</b>, you may override existing navigation key functionality,
+or add your own based upon key names as specified in the {@link Ext.KeyNav KeyNav} class.</p>
+<p>The function is executed in the scope (<code>this</code> reference of the ComboBox. Example:</p><pre><code>
+myCombo.keyNav.esc = function(e) { // Override ESC handling function
+ this.collapse(); // Standard behaviour of Ext's ComboBox.
+ this.setValue(this.startValue); // We reset to starting value on ESC
+};
+myCombo.keyNav.tab = function() { // Override TAB handling function
+ this.onViewClick(false); // Select the currently highlighted row
+};
+</code></pre> ComboBox label : Ext.ElementThe label Element associated with this Field. Only available after this Field has been rendered by a
Ext.layout.FormL...The label Element associated with this Field. Only available after this Field has been rendered by a
Ext.layout.FormLayout layout manager.
Field lastQuery : StringThe value of the match string used to filter the store. Delete this property to force a requery.
Example use:
@@ -938,7 +959,16 @@ Or a shorthand syntax:
scope: this
});Returns:- void
Observable applyToMarkup( String/HTMLElement el
)
:
- voidApply this component to existing markup that is valid. With this function, no call to render() is required.Apply this component to existing markup that is valid. With this function, no call to render() is required.Parameters:el
: String/HTMLElement
Returns:- void
Component clearInvalid()
+ voidApply this component to existing markup that is valid. With this function, no call to render() is required.Apply this component to existing markup that is valid. With this function, no call to render() is required.Parameters:el
: String/HTMLElement
Returns:- void
Component autoSize()
+ :
+ voidAutomatically grows the field to accomodate the width of the text up to the maximum field width allowed.
+This only ta... TextField bubble( Function fn
, [Object scope
], [Array args
] )
+ :
+ Ext.ComponentBubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of...Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of
+function call will be the scope provided or the current component. The arguments to the function
+will be the args provided or the current component. If the function returns false at any point,
+the bubble is stopped.Parameters:fn
: FunctionThe function to callscope
: Object(optional) The scope of the function (defaults to current node)args
: Array(optional) The args to call the function with (default to passing the current component)
Returns:Ext.Component
this
Component clearInvalid()
:
voidClear any invalid styles/messages for this fieldClear any invalid styles/messages for this fieldParameters:- None.
Returns:- void
Field clearValue()
:
@@ -965,47 +995,49 @@ also clears any filter previously saved in the current store (defaults to fa
:
Ext.ComponentEnable this component and fire the 'enable' event.Enable this component and fire the 'enable' event.Parameters:- None.
Returns:Ext.Component
this
Component enableBubble( String/Array events
)
:
- voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
-this.getBubbleTarget() if present...Enables events fired by this Observable to bubble up an owner hierarchy by calling
-this.getBubbleTarget()
if present. There is no implementation in the Observable base class.
-This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default
-implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
-access the required target more quickly.
-Example:
Ext.override(Ext.form.Field, {
- // Add functionality to Field's initComponent to enable the change event to bubble
- initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
- this.enableBubble('change');
- }),
-
- // We know that we want Field's events to bubble directly to the FormPanel.
- getBubbleTarget : function() {
- if (!this.formPanel) {
- this.formPanel = this.findParentByType('form');
- }
- return this.formPanel;
- }
-});
-
-var myForm = new Ext.formPanel({
- title: 'User Details',
- items: [{
- ...
- }],
- listeners: {
- change: function() {
- // Title goes red if form has been modified.
- myForm.header.setStyle('color', 'red');
- }
- }
+ voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
+this.getBubbleTarget() if present....Enables events fired by this Observable to bubble up an owner hierarchy by calling
+this.getBubbleTarget()
if present. There is no implementation in the Observable base class.
+This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default
+implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
+access the required target more quickly.
+Example:
Ext.override(Ext.form.Field, {
+ // Add functionality to Field's initComponent to enable the change event to bubble
+ initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
+ this.enableBubble('change');
+ }),
+
+ // We know that we want Field's events to bubble directly to the FormPanel.
+ getBubbleTarget : function() {
+ if (!this.formPanel) {
+ this.formPanel = this.findParentByType('form');
+ }
+ return this.formPanel;
+ }
+});
+
+var myForm = new Ext.formPanel({
+ title: 'User Details',
+ items: [{
+ ...
+ }],
+ listeners: {
+ change: function() {
+ // Title goes red if form has been modified.
+ myForm.header.setStyle('color', 'red');
+ }
+ }
});
Parameters:events
: String/ArrayThe event name to bubble, or an Array of event names.
Returns:- void
Observable expand()
:
voidExpands the dropdown list if it is currently hidden. Fires the expand event on completion.Expands the dropdown list if it is currently hidden. Fires the expand event on completion.Parameters:- None.
Returns:- void
ComboBox findParentBy( Function fn
)
:
Ext.ContainerFind a container above this component at any level by a custom function. If the passed function returns
true, the con...Find a container above this component at any level by a custom function. If the passed function returns
-true, the container will be returned.Parameters:fn
: FunctionThe custom function to call with the arguments (container, this component).
Returns:Ext.Container
The first Container for which the custom function returns true
Component findParentByType( String/Class xtype
)
+true, the container will be returned.Parameters:fn
: FunctionThe custom function to call with the arguments (container, this component).
Returns:Ext.Container
The first Container for which the custom function returns true
Component findParentByType( String/Ext.Component/Class xtype
, [Boolean shallow
] )
:
- Ext.ContainerFind a container above this component at any level by xtype or classFind a container above this component at any level by xtype or classParameters:xtype
: String/ClassThe xtype string for a component, or the class of the component directly
Returns:Ext.Container
The first Container which matches the given xtype or class
Component fireEvent( String eventName
, Object... args
)
+ Ext.ContainerFind a container above this component at any level by xtype or classFind a container above this component at any level by xtype or classParameters:xtype
: String/Ext.Component/ClassThe xtype to check for this Component. Note that the the component can either be an instance
+or a component class:shallow
: Boolean(optional) False to check whether this Component is descended from the xtype (this is
+the default), or true to check whether this Component is directly of the specified xtype.
Returns:Ext.Container
The first Container which matches the given xtype or class
Component fireEvent( String eventName
, Object... args
)
:
BooleanFires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse...Fires the specified event with the passed parameters (minus the event name).
@@ -1036,7 +1068,63 @@ or use a render listener directly:new Ext.Panel({
},
single: true // Remove the listener after first invocation
}
-});
Parameters:- None.
Returns:Ext.Element
The Element which encapsulates this Component.
Component getHeight()
+});Parameters:- None.
Returns:Ext.Element
The Element which encapsulates this Component.
Component getErrors( Mixed value
)
+ :
+ ArrayValidates a value according to the field's validation rules and returns an array of errors
+for any failing validation...Validates a value according to the field's validation rules and returns an array of errors
+for any failing validations. Validation rules are processed in the following order:
+
+- 1. Field specific validator
+
+
A validator offers a way to customize and reuse a validation specification.
+If a field is configured with a validator
+function, it will be passed the current field value. The validator
+function is expected to return either:
+
+- Boolean true if the value is valid (validation continues).
+- a String to represent the invalid message if invalid (validation halts).
+
+
+- 2. Basic Validation
+
+
If the validator
has not halted validation,
+basic validation proceeds as follows:
+
+allowBlank
: (Invalid message =
+emptyText
)
+Depending on the configuration of allowBlank
, a
+blank field will cause validation to halt at this step and return
+Boolean true or false accordingly.
+
+minLength
: (Invalid message =
+minLengthText
)
+If the passed value does not satisfy the minLength
+specified, validation halts.
+
+maxLength
: (Invalid message =
+maxLengthText
)
+If the passed value does not satisfy the maxLength
+specified, validation halts.
+
+
+
+- 3. Preconfigured Validation Types (VTypes)
+
+
If none of the prior validation steps halts validation, a field
+configured with a vtype
will utilize the
+corresponding VTypes validation function.
+If invalid, either the field's vtypeText
or
+the VTypes vtype Text property will be used for the invalid message.
+Keystrokes on the field will be filtered according to the VTypes
+vtype Mask property.
+
+- 4. Field specific regex test
+
Parameters:value
: MixedThe value to validate. The processed raw value will be used if nothing is passed
Returns:Array
Array of any validation errors
TextField getHeight()
:
NumberGets the current height of the component's underlying element.Gets the current height of the component's underlying element.Parameters:- None.
Returns:Number
BoxComponent getId()
:
@@ -1154,7 +1242,7 @@ of the field. Note: disab...Returns whether or not the f
validating the processed value
of the field. Note: disabled fields are ignored.Parameters:preventMark
: BooleanTrue to disable marking the field invalid
Returns:Boolean
True if the value is valid, else false
Field isVisible()
:
- BooleanReturns true if this component is visible.Returns true if this component is visible.Parameters:- None.
Returns:Boolean
True if this component is visible, false otherwise.
Component isXType( String xtype
, [Boolean shallow
] )
+ BooleanReturns true if this component is visible.Returns true if this component is visible.Parameters:- None.
Returns:Boolean
True if this component is visible, false otherwise.
Component isXType( String/Ext.Component/Class xtype
, [Boolean shallow
] )
:
BooleanTests whether or not this Component is of a specific xtype. This can test whether this Component is descended
from th...Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended
@@ -1166,7 +1254,11 @@ to participate in determination of inherited xtypes.
var t = new Ext.form.TextField();
var isText = t.isXType('textfield'); // true
var isBoxSubclass = t.isXType('box'); // true, descended from BoxComponent
-var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
Parameters:xtype
: StringThe xtype to check for this Componentshallow
: Boolean(optional) False to check whether this Component is descended from the xtype (this is
+var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instanceParameters:xtype
: String/Ext.Component/ClassThe xtype to check for this Component. Note that the the component can either be an instance
+or a component class:
+var c = new Ext.Component();
+console.log(c.isXType(c));
+console.log(c.isXType(Ext.Component));
shallow
: Boolean(optional) False to check whether this Component is descended from the xtype (this is
the default), or true to check whether this Component is directly of the specified xtype.
Returns:Boolean
True if this component descends from the specified xtype, false otherwise.
Component markInvalid( [String msg
] )
:
voidDisplay an error message associated with this field, using msgTarget to determine how to
@@ -1266,23 +1358,30 @@ The sto...Select an item in the dropdown list by its dat
The store must be loaded and the list expanded for this function to work, otherwise use setValue.Parameters:value
: StringThe data value of the item to selectscrollIntoView
: BooleanFalse to prevent the dropdown list from autoscrolling to display the
selected item if it is not currently in view (defaults to true)
Returns:Boolean
True if the value matched an item in the list, else false
ComboBox selectText( [Number start
], [Number end
] )
:
- voidSelects text in this fieldSelects text in this fieldParameters:start
: Number(optional) The index where the selection should start (defaults to 0)end
: Number(optional) The index where the selection should end (defaults to the text length)
Returns:- void
TextField setAutoScroll( Boolean scroll
)
+ voidSelects text in this fieldSelects text in this fieldParameters:start
: Number(optional) The index where the selection should start (defaults to 0)end
: Number(optional) The index where the selection should end (defaults to the text length)
Returns:- void
TextField setActiveError( String msg
, Boolean suppressEvent
)
+ :
+ voidSets the current activeError to the given string. Fires the 'invalid' event.
+This does not set up the error icon, onl...Sets the current activeError to the given string. Fires the 'invalid' event.
+This does not set up the error icon, only sets the message and fires the event. To show the error icon,
+use markInvalid instead, which calls this method internallyParameters:msg
: StringThe error messagesuppressEvent
: BooleanTrue to suppress the 'invalid' event from being fired
Returns:- void
Field setAutoScroll( Boolean scroll
)
:
Ext.BoxComponentSets the overflow on the content element of the component.Sets the overflow on the content element of the component.Parameters:scroll
: BooleanTrue to allow the Component to auto scroll.
Returns:Ext.BoxComponent
this
BoxComponent setDisabled( Boolean disabled
)
:
Ext.ComponentConvenience function for setting disabled/enabled by boolean.Convenience function for setting disabled/enabled by boolean.Parameters:disabled
: Boolean
Returns:Ext.Component
this
Component setEditable( Boolean value
)
:
- voidParameters:value
: BooleanTrue to allow the user to directly edit the field text
-Allow or prevent the user from directly editing the field text. If false is passed,
+ voidAllow or prevent the user from directly editing the field text. If false is passed,
+the user will only be able to mo...Allow or prevent the user from directly editing the field text. If false is passed,
the user will only be able to modify the field using the trigger. Will also add
a click event to the text field which will call the trigger. This method
-is the runtime equivalent of setting the 'editable' config option at config time.Returns:- void
TriggerField setHeight( Number height
)
+is the runtime equivalent of setting the editable config option at config time.Parameters:value
: BooleanTrue to allow the user to directly edit the field text.
Returns:- void
TriggerField setHeight( Mixed height
)
:
- Ext.BoxComponentSets the height of the component. This method fires the resize event.Sets the height of the component. This method fires the resize event.Parameters:height
: NumberThe new height to set. This may be one of:
-- A Number specifying the new height in the Element's Ext.Element.defaultUnits (by default, pixels).
+ Ext.BoxComponentSets the height of the component. This method fires the resize event.Sets the height of the component. This method fires the resize event.Parameters:height
: MixedThe new height to set. This may be one of:
+- A Number specifying the new height in the Element's defaultUnits (by default, pixels).
- A String used to set the CSS height style.
- undefined to leave the height unchanged.
-
Returns:Ext.BoxComponent
this
BoxComponent setMaxValue( Date/String value
)
+Returns:Ext.BoxComponent
this
BoxComponent setHideTrigger( Boolean hideTrigger
)
+ :
+ voidChanges the hidden status of the trigger.Changes the hidden status of the trigger.Parameters:hideTrigger
: BooleanTrue to hide the trigger, false to show it.
Returns:- void
TriggerField setMaxValue( Date/String value
)
:
voidReplaces any existing maxValue with the new time and refreshes the store.Replaces any existing maxValue with the new time and refreshes the store.Parameters:value
: Date/StringThe maximum time that can be selected
Returns:- void
TimeField setMinValue( Date/String value
)
:
@@ -1298,11 +1397,11 @@ This method fires the Sets the underlying DOM field's value directly, bypassing validation. To set the value with validation see setValue.Sets the underlying DOM field's value directly, bypassing validation. To set the value with validation see setValue.Parameters:value
: MixedThe value to set
Returns:Mixed
value The field value that is set
Field setReadOnly( Boolean value
)
:
- voidParameters:value
: BooleanTrue to prevent the user changing the field and explicitly
-hide the trigger.
-Setting this to true will superceed settings editable and hideTrigger.
-Setting this to false will defer back to editable and hideTrigger. This method
-is the runtime equivalent of setting the 'readOnly' config option at config time.
Returns:- void
TriggerField setSize( Mixed width
, Mixed height
)
+ voidSetting this to true will supersede settings editable and hideTrigger.
+Setting this to false will defer back to edita...Setting this to true will supersede settings editable and hideTrigger.
+Setting this to false will defer back to editable and hideTrigger. This method
+is the runtime equivalent of setting the readOnly config option at config time.Parameters:value
: BooleanTrue to prevent the user changing the field and explicitly
+hide the trigger.
Returns:- void
TriggerField setSize( Mixed width
, Mixed height
)
:
Ext.BoxComponentSets the width and height of this BoxComponent. This method fires the resize event. This method can accept
either wid...Sets the width and height of this BoxComponent. This method fires the resize event. This method can accept
@@ -1324,10 +1423,10 @@ will be displayed in the field. If the value does not match the data value of a
and the valueNotFoundText config option is defined, it will be displayed as the default field text.
Otherwise the field will be blank (although the value will still be set).Parameters:value
: StringThe value to match
Returns:Ext.form.Field
this
ComboBox setVisible( Boolean visible
)
:
- Ext.ComponentConvenience function to hide or show this component by boolean.Convenience function to hide or show this component by boolean.Parameters:visible
: BooleanTrue to show, false to hide
Returns:Ext.Component
this
Component setWidth( Number width
)
+ Ext.ComponentConvenience function to hide or show this component by boolean.Convenience function to hide or show this component by boolean.Parameters:visible
: BooleanTrue to show, false to hide
Returns:Ext.Component
this
Component setWidth( Mixed width
)
:
- Ext.BoxComponentSets the width of the component. This method fires the resize event.Sets the width of the component. This method fires the resize event.Parameters:width
: NumberThe new width to setThis may be one of:
-- A Number specifying the new width in the Element's Ext.Element.defaultUnits (by default, pixels).
+ Ext.BoxComponentSets the width of the component. This method fires the resize event.Sets the width of the component. This method fires the resize event.Parameters:width
: MixedThe new width to set. This may be one of:
+- A Number specifying the new width in the Element's defaultUnits (by default, pixels).
- A String used to set the CSS width style.
Returns:Ext.BoxComponent
this
BoxComponent show()
:
@@ -1341,7 +1440,11 @@ after the Force the component's size to recalculate based on the underlying element's current height and width.Force the component's size to recalculate based on the underlying element's current height and width.Parameters:- None.
Returns:Ext.BoxComponent
this
BoxComponent un( String eventName
, Function handler
, [Object scope
] )
:
- voidRemoves an event handler (shorthand for removeListener.)Removes an event handler (shorthand for removeListener.)Parameters:eventName
: StringThe type of event the handler was associated with.handler
: FunctionThe handler to remove. This must be a reference to the function passed into the addListener call.scope
: Object(optional) The scope originally specified for the handler.
Returns:- void
Observable update( Mixed htmlOrData
, [Boolean loadScripts
], [Function callback
] )
+ voidRemoves an event handler (shorthand for removeListener.)Removes an event handler (shorthand for removeListener.)Parameters:eventName
: StringThe type of event the handler was associated with.handler
: FunctionThe handler to remove. This must be a reference to the function passed into the addListener call.scope
: Object(optional) The scope originally specified for the handler.
Returns:- void
Observable unsetActiveError( Boolean suppressEvent
)
+ :
+ voidClears the activeError and fires the 'valid' event. This is called internally by clearInvalid and would not
+usually n...Clears the activeError and fires the 'valid' event. This is called internally by clearInvalid and would not
+usually need to be called manuallyParameters:suppressEvent
: BooleanTrue to suppress the 'invalid' event from being fired
Returns:- void
Field update( Mixed htmlOrData
, [Boolean loadScripts
], [Function callback
] )
:
voidUpdate the content area of a component.Update the content area of a component.Parameters:htmlOrData
: MixedIf this component has been configured with a template via the tpl config
then it will use this argument as data to populate the template.
@@ -1350,63 +1453,13 @@ content area will be updated via Ext.Element updateloadScri
:
Ext.BoxComponentSets the current box measurements of the component's underlying element.Sets the current box measurements of the component's underlying element.Parameters:box
: ObjectAn object in the format {x, y, width, height}
Returns:Ext.BoxComponent
this
BoxComponent validate()
:
- BooleanValidates the field valueValidates the field valueParameters:- None.
Returns:Boolean
True if the value is valid, else false
Field validateValue( Mixed value
)
+ BooleanValidates the field valueValidates the field valueParameters:- None.
Returns:Boolean
True if the value is valid, else false
Field validateValue( Mixed The
)
:
- BooleanValidates a value according to the field's validation rules and marks the field as invalid
-if the validation fails. V...Validates a value according to the field's validation rules and marks the field as invalid
-if the validation fails. Validation rules are processed in the following order:
-
-- 1. Field specific validator
-
-
A validator offers a way to customize and reuse a validation specification.
-If a field is configured with a validator
-function, it will be passed the current field value. The validator
-function is expected to return either:
-
-- Boolean true if the value is valid (validation continues).
-- a String to represent the invalid message if invalid (validation halts).
-
-
-- 2. Basic Validation
-
-
If the validator
has not halted validation,
-basic validation proceeds as follows:
-
-allowBlank
: (Invalid message =
-emptyText
)
-Depending on the configuration of allowBlank
, a
-blank field will cause validation to halt at this step and return
-Boolean true or false accordingly.
-
-minLength
: (Invalid message =
-minLengthText
)
-If the passed value does not satisfy the minLength
-specified, validation halts.
-
-maxLength
: (Invalid message =
-maxLengthText
)
-If the passed value does not satisfy the maxLength
-specified, validation halts.
-
-
-
-- 3. Preconfigured Validation Types (VTypes)
-
-
If none of the prior validation steps halts validation, a field
-configured with a vtype
will utilize the
-corresponding VTypes validation function.
-If invalid, either the field's vtypeText
or
-the VTypes vtype Text property will be used for the invalid message.
-Keystrokes on the field will be filtered according to the VTypes
-vtype Mask property.
-
-- 4. Field specific regex test
-
Parameters:value
: MixedThe value to validate
Returns:Boolean
True if the value is valid, else false
TextField
Public Events
Event Defined By added :
+ BooleanUses getErrors to build an array of validation errors. If any errors are found, markInvalid is called
+with the first ...Uses getErrors to build an array of validation errors. If any errors are found, markInvalid is called
+with the first and false is returned, otherwise true is returned. Previously, subclasses were invited
+to provide an implementation of this to process validations - from 3.2 onwards getErrors should be
+overridden instead.Parameters:The
: Mixedcurrent value of the field
Returns:Boolean
True if all validations passed, false if one or more failed
Field
Public Events
Event Defined By added :
( Ext.Component this
, Ext.Container ownerCt
, number index
)
Fires when a component is added to an Ext.ContainerFires when a component is added to an Ext.ContainerListeners will be called with the following arguments:this
: Ext.ComponentownerCt
: Ext.ContainerContainer which holds the componentindex
: numberPosition at which the component was added
Component afterrender :
( Ext.Component this
)