I have a Sencha ExtJS application where the user enters some data into an input form and then selects a color associated with that item. After they click the save button in the form the form closes and creates a button for the new item. I am basically trying to figure out how to change the background color of the button to correspond to what the user selects. I have done a bunch of searching and found the majority do it via CSS and setting the cls property. That would be fine if I crated a line in the css file for every color in the color picker but there must be a way to dynamically set the button background color when the color is not know up front.
layoutRoot.down('#pnlTest').add({ xtype: 'button', text: obj.name, height: 25, width: 125, margin: '5', });