PDA

View Full Version : Adding CSS to Radio Button BoxLabel



JNason
25 Oct 2007, 9:57 AM
I'm feeling exceptionally stupid today. I just want to make the text in the boxLabel attached to a radio button grey when the button is disabled. I can't figure out how to do it. I've managed to change the css of just about everything else on the form, but this one is escaping me.



new Ext.form.Radio({
boxLabel:'Sample Disabled Button',
name:'use',
disabled: true,
checked:false,
width:'auto',
inputValue: '1'
});

JNason
25 Oct 2007, 10:12 AM
Ok. I figured it out.

I just added a itemCls to the button and added label to the css and it worked.

js

new Ext.form.Radio({
boxLabel:'Sample Disabled Button',
name:'use',
disabled: true,
checked:false,
width:'auto',
inputValue: '1',
itemCls: 'disabledButton '
});


css


.disabledButton label{color:gray}

Why is it that I can spend all day trying to figure something out on my own and I get no where. The second I post a question, I figure it out. :-/

rsravishankar
26 Oct 2014, 5:48 AM
Thank you, this helped me. Initially I thought just setting the disabledCls should work. Now I find that the class assigned to disabledCls followed by label (e.g. if
disabledCls: 'abc_class' in my ExtJS code, then css should go:


abc_class label {color: gray} . A similar thing holds true for input
abc_class input {
color: #afafaf !important;
opacity: .3;
-moz-opacity: .3;
filter: alpha(opacity=30);
}

Btw how did you get to this? This is my first app and I'd appreciate guidance.Thanks.

nomadtrails
20 Mar 2015, 10:56 PM
thank you

allessandra
28 Dec 2015, 5:02 AM
Thanks for asking. I have also same issue.