PDA

View Full Version : Cannot get button by find field and name



hieu79vn
3 Sep 2012, 12:59 AM
Hello

I have an Ext.form.panel, and I can get its component by
this.getForm().findField('xxx').setDisabled(bool);
this.getForm().findField('yy').setReadOnly(bool);

but I cannot use findField for buttons which are direct children or children of an xtype: 'container' in the form

Thank you

dawesi
3 Sep 2012, 1:13 AM
why not use componentQuery built into formpanel to get items.




allFields = form.query('field,button');
allFields.each(funtion(item,index,allfields) {
item.setDisabled = true;
item.setReadOnly = true;
});

hieu79vn
3 Sep 2012, 1:50 AM
Hi Dawesi
Thank you for your answer but I would like to disable only some items