PDA

View Full Version : [CLOSED][3.??] Field setDisabled



bereal
6 Aug 2009, 7:31 AM
I don't know why, but this simple thing doesn't work :



this.closeForm.deradio.setDisabled(true);


At the same time, this works:



this.closeForm.deradio.el.dom.disabled = true;


This gives "radio"


debug(this.closeForm.deradio.xtype);

evant
6 Aug 2009, 6:15 PM
Please post a test case so that we can be sure of the behaviour you're seeing.

evant
6 Aug 2009, 10:47 PM
For example:



Ext.onReady(function(){
var form = new Ext.form.FormPanel({
width: 400,
height: 400,
renderTo: document.body,
items: {
fieldLabel: 'foo',
xtype: 'radio',
boxLabel: 'bar'
}
});
form.items.first().disable();
});


Behaves as I would expect.

bereal
6 Aug 2009, 11:15 PM
Ext.onReady(function() {
var form = new Ext.form.FormPanel({items: [
{xtype: 'fieldset', defaults: {xtype: 'radio'}, title:'Test', items: [
{ref: '../naradio', fieldLabel: 'Close Action', xtype: 'radio', boxLabel: 'Set 1', name: 'NEW_STATUS'},
{ref: '../niradio', fieldLabel: '', labelSeparator: '', xtype: 'radio', boxLabel: 'Set 2', name: 'NEW_STATUS'},
{ref: '../deradio', fieldLabel: '', labelSeparator: '', xtype: 'radio', boxLabel: 'Set 3', name: 'NEW_STATUS'},
]},
]})

var w = new Ext.Window({
width: 400,
height: 400,
items: [form]
});
w.show();

form.naradio.setDisabled();//doesnt work

form.niradio.el.dom.disabled = true; //works

});

evant
6 Aug 2009, 11:23 PM
This isn't a bug, setDisabled takes an argument to indicate the disabled status, either use:



form.naradio.setDisabled(true);
// OR
form.naradio.disable();


Marking this as closed.

bereal
6 Aug 2009, 11:48 PM
Yeah, you are right, our fault.

Actually, problem was because of our customization to Ext.

Sorry