Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/src/widgets/form/TriggerField.js view on Meta::CPAN
/*
This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License Usage
This file may be used under the terms of the GNU General Public License version 3.0 as
published by the Free Software Foundation and appearing in the file LICENSE included in the
packaging of this file.
Please review the following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2013-04-03 15:07:25
*/
/**
* @class Ext.form.TriggerField
* @extends Ext.form.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 {@link #onTriggerClick}. You can create a TriggerField directly, as it renders exactly like a combobox
* for which you can provide a custom implementation. For example:
* <pre><code>
var trigger = new Ext.form.TriggerField();
trigger.onTriggerClick = myTriggerFn;
trigger.applyToMarkup('my-field');
</code></pre>
*
* However, in general you will most likely want to use TriggerField as the base class for a reusable component.
* {@link Ext.form.DateField} and {@link Ext.form.ComboBox} are perfect examples of this.
*
* @constructor
* Create a new TriggerField.
* @param {Object} config Configuration options (valid {@Ext.form.TextField} config options will also be applied
* to the base TextField)
* @xtype trigger
*/
Ext.form.TriggerField = Ext.extend(Ext.form.TextField, {
/**
* @cfg {String} triggerClass
* An additional CSS class used to style the trigger button. The trigger will always get the
* class <tt>'x-form-trigger'</tt> by default and <tt>triggerClass</tt> will be <b>appended</b> if specified.
*/
/**
* @cfg {Mixed} triggerConfig
* <p>A {@link Ext.DomHelper DomHelper} config object specifying the structure of the
* trigger element for this Field. (Optional).</p>
* <p>Specify this when you need a customized element to act as the trigger button for a TriggerField.</p>
* <p>Note that when using this option, it is the developer's responsibility to ensure correct sizing, positioning
* and appearance of the trigger. Defaults to:</p>
* <pre><code>{tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.triggerClass}</code></pre>
*/
/**
* @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: "16", autocomplete: "off"}</code></pre>
*/
defaultAutoCreate : {tag: "input", type: "text", size: "16", autocomplete: "off"},
/**
* @cfg {Boolean} hideTrigger <tt>true</tt> to hide the trigger element and display only the base
* text field (defaults to <tt>false</tt>)
*/
hideTrigger:false,
/**
* @cfg {Boolean} editable <tt>false</tt> to prevent the user from typing text directly into the field,
* the field will only respond to a click on the trigger to set the value. (defaults to <tt>true</tt>).
*/
editable: true,
/**
* @cfg {Boolean} readOnly <tt>true</tt> to prevent the user from changing the field, and
* hides the trigger. Superceeds the editable and hideTrigger options if the value is true.
* (defaults to <tt>false</tt>)
*/
readOnly: false,
/**
* @cfg {String} wrapFocusClass The class added to the to the wrap of the trigger element. Defaults to
* <tt>x-trigger-wrap-focus</tt>.
*/
( run in 1.053 second using v1.01-cache-2.11-cpan-02777c243ea )