PDA

View Full Version : [FIXED-447][2.x/3.x] Fieldset renders incorrectly with different baseCls



Condor
24 Dec 2009, 2:05 AM
(minor)

Changing the baseCls of a Fieldset will cause a misrender (2 headers are created, one <legend class="x-fieldset-header"> and one <div class="myBaseCls-header">).

Suggested fix:

Ext.override(Ext.form.FieldSet, {
onRender : function(ct, position){
if(!this.el){
this.el = document.createElement('fieldset');
this.el.id = this.id;
if (this.title || this.header || this.checkboxToggle) {
this.el.appendChild(document.createElement('legend')).className = this.baseCls + '-header';
}
}
Ext.form.FieldSet.superclass.onRender.call(this, ct, position);
if(this.checkboxToggle){
var o = typeof this.checkboxToggle == 'object' ?
this.checkboxToggle :
{tag: 'input', type: 'checkbox', name: this.checkboxName || this.id+'-checkbox'};
this.checkbox = this.header.insertFirst(o);
this.checkbox.dom.checked = !this.collapsed;
this.mon(this.checkbox, 'click', this.onCheckClick, this);
}
}
});

Condor
19 Jan 2010, 4:01 AM
*** Bump ***

evant
19 Jan 2010, 5:48 AM
Fixed in SVN, rev 5915.