PDA

View Full Version : [2.0b1/rc1] Fieldset doesn't care of id



tof
18 Oct 2007, 5:01 AM
The fieldset ignores the id given in the config.

But it's registered in the ComponentMgr with the given id...

Exemple:

f = new FormPanel({title:'test',
items:[{
xtype:'fieldset',
id:'my-id'
}]
});
On the rendering, the fieldset will have an 'ext-genXX' id, bug the componentMgr will have it registerd as 'my-id'.

Consequence :
Ext.getCmp('my-id') will work, but
Ext.getCmp('ext-genXX') won't.

My workaround for now :

Ext.form.FieldSet.prototype.onRender = function(ct, position){
console.log('onRender', this.id);
if(!this.el){
this.el = document.createElement('fieldset');
this.el.id = this.id; // FIXME
this.el.appendChild(document.createElement('legend')).className = 'x-fieldset-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.checkbox.on('click', this.onCheckClick, this);
}
};


Edit : the problem seems to be also on toolbar, tbbuttons....
Is this wanted ?

Darklight
6 Nov 2007, 8:53 AM
confirmed and still in the RC as well