View Full Version : Has form Layout trackLabels been fixed in 3.1.1

Keith Chadwick
10 Feb 2010, 7:49 AM
I have a fairly complex form that is rendered in a modal window. After I show the window I have several tests to decide which form components to show or hide. When I use Ext.getCmp('controlID').setVisible((mytest)) the control hides and shows correctly but the label never hides.

I have read through many posts regarding this issue in this forum and the 3x bug forum and I am unclear if this issue has been resolved yet.

I did manage to get it to work with Ext.layout.FormLayout.prototype.trackLabels = true as suggested by Animal on the post http://www.extjs.com/forum/showthread.php?p=120152#post120152

My config is as follows but did not work until I did the prototype (below is just a partial), as you can see I tried putting trackLabels just about everywhere:

title: 'Note',
layout: 'fit',
width: 800,
height: 550,
closeAction: 'close',
plain: true,
modal: true,

items: [{
xtype: 'form',
id: 'coreNote',
autoTabs: true,
activeTab: 0,
deferredRender: false,
border: false,
defaultType: 'textfield',
padding: '20',
monitorValid: true,
method: 'POST',
defaults: {
anchor: '100%',
items: [{
xtype: 'label',
cls: 'noteMessage ' + clsClass,
html: message,
hidden: topMessageHidden
}, {
xtype: 'displayfield',
fieldLabel: 'Object',
value: mb3.core.title.getTitle()
}, {
xtype: 'textfield',
id: 'coreNoteSubject',
fieldLabel: 'Subject',
name: 'subject',
allowBlank: false,
value: current.title
}, {
xtype: 'htmleditor',
fieldLabel: 'Note',
height: 150,
fielLabel: 'Note',
allowBlank: false,
id: 'coreNoteComment',
value: current.comment
}, {
xtype: 'checkbox',
fieldLabel: 'Mark As Resolved',
checked: false,


26 Feb 2010, 10:22 AM
I have something similar, and when trying to hide a TextField, the label never goes away... I have added the trackLabels and boiled my form down to its most basic, but the label will never get hidden. Any ideas?

var form = new Ext.form.FormPanel({
bodyStyle: 'padding-top: 5px;'
, id: 'content-group-form'
, labelWidth: 110
, hideMode: 'offsets'
, width: 385
, trackLabels: true
, defaults: {
width: 200
, border: false
, frame: false
, plain: true
, items: [{
xtype: 'textarea'
, fieldLabel: 'Content'
, id: 'content-group-form-content'
, name: 'content-group-form-content'
}, {
xtype: 'checkbox'
, boxLabel: 'Enable'
, id: 'content-group-form-enabled'
, name: 'content-group-form-enabled'
, buttons: [
{text: 'Hide', handler: function() {
var textarea = Ext.getCmp('content-group-form-content');

if (textarea.hidden) {
} else {

22 Mar 2010, 11:39 PM

my Problem is similiar to yours but hopefully I can help you with my previous solution.

You can try this:


With the last line you can hide the label. But this solution only works after all comps has been finished. If not you get an Error like this: "comp.getEl() is undefined".

But for me this solution is no longer working because when I initialize the Element I must hide it immediately and then i get errors like above.

So any solutions or ideas?


4 Oct 2010, 8:39 AM
While this is a global change, Condor had a good solution. Before you build your form, just set trackLabels to true in Ext's defaults.

Ext.layout.FormLayout.prototype.trackLabels = true;

I tried every solution out there and this it the only one that worked. Don't know what the problem is.