PDA

View Full Version : Can't get style to work on button



jkisner
4 Dec 2007, 9:13 PM
Hello...I'm trying to add style to a button during button creation but for some reason it won't work.



var newButton = navbar.addButton({
text: 'Contact Us',
tooltip: 'Contact Us',
style: "color:red"
});


I've also tried style:{color:"red"} and that doesn't work either. Also if I use cls: and a class name nothing happens. Any ideas?

tryanDLS
5 Dec 2007, 2:59 PM
Look at the rendered HTML in firebug. Given that a button is rendered as a TABLE, it's not likely that you can just set color:red on the element - you'll probably have to add a class to add the color to specific html element e.g. the BUTTON.

jkisner
5 Dec 2007, 5:13 PM
Does anyone actually have an example of how to use the cls property with a user created class, not the built in ones? I'd like to see the javascript and css.