PDA

View Full Version : Disabling radio buttons in Ext.js



archmonk
21 Aug 2014, 9:15 AM
I am trying to disable radio buttons based on a certain condition but somehow it isn't working for me.
I would like to know what is the ext.js way of doing it.

I have something like in a settingspanel.js page

...
{
xtype: 'fieldcontainer',
fieldLabel: "abc",

layout: 'hbox',
items: [{
xtype: 'checkbox',
name: 'abc'
}, {
xtype: 'help',
text: "this is abc."
}]....
and i am trying to do something like this:

{
xtype: 'fieldcontainer',
fieldLabel: "abc",
disabled: condition === "disableme" ? true:false
layout: 'hbox',
items: [{
xtype: 'checkbox',
name: 'abc'
}, {
xtype: 'help',
text: "this is abc."
}]
But this doesn't work. What am I doing wrong ?

Gary Schlosberg
21 Aug 2014, 3:27 PM
Seems to work for me when I set the disabled option on the example on the radiofield (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.Radio) doc page. Are you sure your 'condition' variable is being set correctly?