3 * @class Ext.layout.component.field.Trigger
4 * @extends Ext.layout.component.field.Field
5 * Layout class for {@link Ext.form.field.Trigger} fields. Adjusts the input field size to accommodate
6 * the trigger button(s).
10 Ext.define('Ext.layout.component.field.Trigger', {
12 /* Begin Definitions */
14 alias: ['layout.triggerfield'],
16 extend: 'Ext.layout.component.field.Field',
22 sizeBodyContents: function(width, height) {
25 inputEl = owner.inputEl,
26 triggerWrap = owner.triggerWrap,
27 triggerWidth = owner.getTriggerWidth();
29 // If we or our ancestor is hidden, we can get a triggerWidth calculation
30 // of 0. We don't want to resize in this case.
31 if (owner.hideTrigger || owner.readOnly || triggerWidth > 0) {
32 // Decrease the field's width by the width of the triggers. Both the field and the triggerWrap
33 // are floated left in CSS so they'll stack up side by side.
34 me.setElementSize(inputEl, Ext.isNumber(width) ? width - triggerWidth : width);
36 // Explicitly set the triggerWrap's width, to prevent wrapping
37 triggerWrap.setWidth(triggerWidth);