PDA

View Full Version : How do I disable a specific component



Albyx
9 Jun 2010, 2:23 AM
How do I disable a specific component (by name) in multiple instances of the same form inserted into a tab panel?
Thanks in advance...:)
This is my code:


var forms = Ext.getCmp('tabsPrecaricamento').findByType('panel'); //.findById('regime');

Ext.each(forms, function(form, index, allItems) {

var cmpRegime = form.getComponent('regimeId');
alert(cmpRegime.name);
if(cmpRegime.disabled)
cmpRegime.disable();
else
cmpRegime.enable();
},this);

CrazyEnigma
9 Jun 2010, 11:33 PM
I would use find() and setDisabled() instead

Albyx
14 Jun 2010, 7:21 AM
Ok, i solved.

CrazyEnigma
14 Jun 2010, 2:00 PM
You solved it. Share please. Write [SOLVED] in the originals post's title.