X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..c8256059947f3aa8f5b0a9a2acf55e2142bb4742:/docs/output/Ext.form.TriggerField.html diff --git a/docs/output/Ext.form.TriggerField.html b/docs/output/Ext.form.TriggerField.html index c0b00b5f..d84c6219 100644 --- a/docs/output/Ext.form.TriggerField.html +++ b/docs/output/Ext.form.TriggerField.html @@ -1,4 +1,4 @@ -
Observable
  Component
    BoxComponent
      Field
        TextField
          TriggerField

Class Ext.form.TriggerField

Package:Ext.form
Defined In:TriggerField.js
Class:TriggerField
Subclasses:ComboBox, DateField, TwinTriggerField
Extends:TextField
Provides a convenient wrapper for TextFields that adds a clickable trigger button (looks like a combobox by default). +
Observable
  Component
    BoxComponent
      Field
        TextField
          TriggerField

Class Ext.form.TriggerField

Package:Ext.form
Defined In:TriggerField.js
Class:TriggerField
Subclasses:ComboBox, DateField, TwinTriggerField
Extends:TextField
Provides a convenient wrapper for TextFields that adds a clickable trigger button (looks like a combobox by default). The trigger has no default action, so you must assign a function to implement the trigger click handler by overriding onTriggerClick. You can create a TriggerField directly, as it renders exactly like a combobox for which you can provide a custom implementation. For example: @@ -136,7 +136,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 : Number
The 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 : String
The 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 : Array
An 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 : String
The 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').

@@ -446,9 +449,9 @@ validation fails (defaults to 'The maximum length for this field is {maxL...'The maximum length for this field is {maxLength}')
TextField minLength : Number
Minimum input field length required (defaults to 0)
TextField minLengthText : String
Error 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 msgFx : String
Experimental The effect used when displaying a validation message under the field -(defaults to 'normal').
Field msgTarget<p>The : String
location where the message text set through markInvalid should display. +(defaults to 'normal').
Field msgTarget : String
The 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. @@ -457,7 +460,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 : String
The field's HTML name attribute (defaults to ''). +
Field name : String
The 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 : String
An optional extra CSS class that will be added to this component's Element when the mouse moves @@ -765,38 +768,38 @@ should usually not need to be called directly.
Enable this component and fire the 'enable' event.
Enable this component and fire the 'enable' event.
Parameters:
  • None.
Returns:
  • Ext.Component
    this
Component enableBubbleString/Array events ) : - void
Enables 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');
-        }
-    }
+                                        void
Enables 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/Array
    The event name to bubble, or an Array of event names.
Returns:
  • void
Observable findParentByFunction fn ) : Ext.Container
Find a container above this component at any level by a custom function. If the passed function returns @@ -834,7 +837,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 getErrorsMixed value ) + : + Array
Validates 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 +
    +

    If none of the prior validation steps halts validation, a field's +configured regex test will be processed. +The invalid message for this test is configured with +regexText.

    +
  • Parameters:
    • value : Mixed
      The value to validate. The processed raw value will be used if nothing is passed
    Returns:
    • Array
      Array of any validation errors
TextField getHeight() : Number
Gets 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() : @@ -1015,7 +1074,12 @@ event...
Resume firing events. (see Parameters:
  • None.
Returns:
  • void
Observable selectText[Number start][Number end] ) : - void
Selects text in this field
Selects text in this field
Parameters:
  • 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 setAutoScrollBoolean scroll ) + void
Selects text in this field
Selects text in this field
Parameters:
  • 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 setActiveErrorString msgBoolean suppressEvent ) + : + void
Sets 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 internally
Parameters:
  • msg : String
    The error message
  • suppressEvent : Boolean
    True to suppress the 'invalid' event from being fired
Returns:
  • void
Field setAutoScrollBoolean scroll ) : Ext.BoxComponent
Sets the overflow on the content element of the component.
Sets the overflow on the content element of the component.
Parameters:
  • scroll : Boolean
    True to allow the Component to auto scroll.
Returns:
  • Ext.BoxComponent
    this
BoxComponent setDisabledBoolean disabled ) : @@ -1025,10 +1089,10 @@ events fired during event suspension will be sent to any listeners now.
Returns:
  • void
TriggerField setHeightNumber height ) +is the runtime equivalent of setting the 'editable' config option at config time.Returns:TriggerField setHeightMixed height ) : - Ext.BoxComponent
Sets 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 : Number
    The 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.BoxComponent
      Sets 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 : Mixed
        The 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 setPagePositionNumber xNumber y ) @@ -1065,10 +1129,10 @@ This may be one of:
        : Ext.form.Field
        Sets a data value into the field and validates it. To set the value directly without validation see setRawValue.
        Sets a data value into the field and validates it. To set the value directly without validation see setRawValue.
        Parameters:
        • value : Mixed
          The value to set
        Returns:
        • Ext.form.Field
          this
        Field setVisibleBoolean visible ) : - Ext.Component
        Convenience function to hide or show this component by boolean.
        Convenience function to hide or show this component by boolean.
        Parameters:
        • visible : Boolean
          True to show, false to hide
        Returns:
        • Ext.Component
          this
        Component setWidthNumber width ) + Ext.Component
        Convenience function to hide or show this component by boolean.
        Convenience function to hide or show this component by boolean.
        Parameters:
        • visible : Boolean
          True to show, false to hide
        Returns:
        • Ext.Component
          this
        Component setWidthMixed width ) : - Ext.BoxComponent
        Sets 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 : Number
          The new width to setThis may be one of:
          BoxComponent unString eventNameFunction handler[Object scope] ) : - void
          Removes an event handler (shorthand for removeListener.)
          Removes an event handler (shorthand for removeListener.)
          Parameters:
          • eventName : String
            The type of event the handler was associated with.
          • handler : Function
            The 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 updateMixed htmlOrData[Boolean loadScripts][Function callback] ) + void
          Removes an event handler (shorthand for removeListener.)
          Removes an event handler (shorthand for removeListener.)
          Parameters:
          • eventName : String
            The type of event the handler was associated with.
          • handler : Function
            The 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 unsetActiveErrorBoolean suppressEvent ) + : + void
          Clears 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 manually
          Parameters:
          • suppressEvent : Boolean
            True to suppress the 'invalid' event from being fired
          Returns:
          • void
          Field updateMixed htmlOrData[Boolean loadScripts][Function callback] ) : void
          Update the content area of a component.
          Update the content area of a component.
          Parameters:
          • htmlOrData : Mixed
            If this component has been configured with a template via the tpl config then it will use this argument as data to populate the template. @@ -1091,63 +1159,13 @@ content area will be updated via Ext.Element update
          • loadScri : Ext.BoxComponent
            Sets the current box measurements of the component's underlying element.
            Sets the current box measurements of the component's underlying element.
            Parameters:
            • box : Object
              An object in the format {x, y, width, height}
            Returns:
            • Ext.BoxComponent
              this
            BoxComponent validate() : - Boolean
            Validates the field value
            Validates the field value
            Parameters:
            • None.
            Returns:
            • Boolean
              True if the value is valid, else false
            Field validateValueMixed value ) + Boolean
            Validates the field value
            Validates the field value
            Parameters:
            • None.
            Returns:
            • Boolean
              True if the value is valid, else false
            Field validateValueMixed The ) : - Boolean
            Validates 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 -
              -

              If none of the prior validation steps halts validation, a field's -configured regex test will be processed. -The invalid message for this test is configured with -regexText.

              -
            • Parameters:
              • value : Mixed
                The value to validate
              Returns:
              • Boolean
                True if the value is valid, else false
            TextField

            Public Events

            EventDefined By

            Public Events

            EventDefined By