PDA

View Full Version : [FIXED][3.0rc1.1/rc2] boxLabel not hidden on formfield hide



cmuscat
8 May 2009, 6:10 AM
I've got a FormPanel with a checkbox in a window.
The boxlabel is still displayed even if the checkbox is hidden.

It work's fine with extjs 2.2.1, occurs with 3.0 rc1.1


var form = new Ext.form.FormPanel({height: 570});
form.add(new Ext.form.Checkbox({
fieldLabel: 'fieldlabel',
boxLabel: 'boxlabel',
name: 'mychkbox',
hidden: true
})
);
new Ext.Window({
title: 'window'
,modal:true
,closable:true
,width:600
,y: 0
,resizable: true
,defaults: {autoScroll:true, bodyStyle:'padding:8px', labelWidth:175}
,layout: 'anchor'
,items: form
});

cmuscat
8 May 2009, 6:13 AM
form.add(new Ext.form.Checkbox({
fieldLabel: 'fieldlabel',
boxLabel: 'boxlabel',
name: 'mychkbox',
hidden: true,
onHide: function(){this.getEl().up('.x-form-item').setDisplayed(false);},
onShow: function(){this.getEl().up('.x-form-item').setDisplayed(true);}
})
);



If the checkbox is initialized with onHide, onShow, it works fine. But I think this should not be the solution. ;)

cmuscat
8 May 2009, 6:24 AM
I needed this onHide/onShow workaround also for ComboBox in 2.2.1.
Perhaps this could be fixed, too ?

Condor
8 May 2009, 7:29 AM
Yes, this workaround:

Ext.override(Ext.form.TriggerField, {
actionMode: 'wrap',
onShow: Ext.form.TriggerField.superclass.onShow,
onHide: Ext.form.TriggerField.superclass.onHide
});
Ext.override(Ext.form.Checkbox, {
actionMode: 'wrap',
getActionEl: Ext.form.Checkbox.superclass.getActionEl
});
Ext.override(Ext.form.HtmlEditor, {
actionMode: 'wrap'
});

But I would prefer to implement the entire fix from the original thread (http://www.extjs.com/forum/showthread.php?p=120152#post120152) so fieldLabels are also hidden with the field.

cmuscat
11 May 2009, 2:52 AM
Thanks a lot, I didn't find this topic. The descriped workaorund works for me :)

mschwartz
4 Jun 2009, 10:35 AM
Not fixed in RC2 for textfield, inputType=password

mjlecomte
18 Jun 2009, 9:36 AM
Just an update: this issue appears to be still OPEN as of now, but the plan is to defer this until after the release of 3.0 final.

evant
23 Jul 2009, 7:03 PM
This has already been fixed in SVN, marking as fixed.