PDA

View Full Version : Height of TriggerField



gagahhag
16 Nov 2010, 2:20 AM
Hi
I tried to set the height of a TriggerField manually to e.g. 30px. I used the height property which has no effect. On TextField itself it works as expected.


{
xtype: 'textfield',
height: 30 // works
},
{
xtype: 'trigger',
height: 30 // doesn't work
}

Inspecting the elements with Firebug, the textfield has the style 'height' set but not the triggerfield... Manually set the height in FireBug works, but not with property itself. Bug?

Thanks for your help,
Andi

JanVenekamp
16 Nov 2010, 4:13 AM
TriggerField has deferHeight = true, so it can not set it's own height. See the source of BoxComponent: http://dev.sencha.com/deploy/dev/docs/source/BoxComponent.html#cls-Ext.BoxComponent

laurentParis
16 Nov 2010, 4:59 AM
True but you can pass over with this code :


{
xtype: 'textfield',
height: 30 // works
},
{
xtype: 'trigger',
deferHeight: false,
onRender: function (ct, position) {
this.constructor.prototype.onRender.call(this, ct, position);
this.resizeEl = this.el;
},
height: 30 // doesn't work
}


or extend trigger field with this modification

ps : with this modif, only input field is resize... you need to resize triggerField too to complete

gagahhag
16 Nov 2010, 6:05 AM
Thanks for your replies,
I'll try to get this running. Strange to have the height in the API without a remark on the deferHeight...

Actually I' just want to have an icon next to the text field to have an own event on it. Thought the trigger field fits. I don't want to extend the text field to do so.