PDA

View Full Version : cannot use setText on a label



rich71
5 Aug 2010, 8:11 AM
Hello,

I would like to know if this is a bug or something else
I try to set a text on a label, but what I get back is
....is not a function

The label

{xtype: 'label',fieldLabel:'somename',itemId:'myid'}

It does find the component


aa= this.find('itemId','myid');
console.log(aa);
aa.setText('kaboem');Thanks, Richard

Condor
5 Aug 2010, 8:13 AM
Is the 'kaboem' component an Ext.form.Label or an Ext.form.Field with a fieldLabel?

rich71
5 Aug 2010, 8:18 AM
Is the 'kaboem' component an Ext.form.Label or an Ext.form.Field with a fieldLabel?
I found the answer, it's because find returns an array

So it's

aa[0].setText('')