PDA

View Full Version : trackLabels work?



mitchellsimoens
8 Apr 2010, 6:30 PM
So I want to have the label hide when the field is hidden however I cannot get it to work. I've tried 2 ways:


xtype : "textfield",
id : "remoteLocation",
fieldLabel : "Location",
anchor : "100%",
trackLabels: true,
hidden : true

and:


xtype : "textfield",
id : "remoteLocation",
fieldLabel : "Location",
anchor : "100%",
trackLabels: true
and calling:


Ext.getCmp("remoteLocation").hide();

However the label is still there. Now if I set hideLabel: true then it will hide it but when the field is shown again, the label is not there and the space is gone as well.

Now I can setup an event listener for hide on the textfield and do:

t.label.hide();
but doesn't that defeat the purpose of the trackLabels config option?

evant
8 Apr 2010, 6:38 PM
http://www.extjs.com/deploy/dev/docs/?class=Ext.layout.FormLayout&member=trackLabels

mitchellsimoens
8 Apr 2010, 6:40 PM
http://www.extjs.com/deploy/dev/docs/?class=Ext.layout.FormLayout&member=trackLabels

Yes I know, that is how I found it. I can produce screenshots but it's not working for me when I set hidden: true in the config or if I call the hide() method. I have a Window with a form and a few textfields but the label remains unless I hide() the label Element.

evant
8 Apr 2010, 6:42 PM
As in, it's an option on the form layout. You're specifying it as an option on the text field.

mitchellsimoens
8 Apr 2010, 6:43 PM
Wow... ok I'm wrong lol Thanks! =D>