PDA

View Full Version : How to change style of panel?



dbassett74
16 Aug 2010, 7:25 AM
I'm trying to set the background color of a panel using this in the config:



style: {
backgroundColor: "#CEDFF5"
},


but it is not working. What is the correct syntax?

fay
16 Aug 2010, 8:02 AM
That syntax is correct, and easily tested. Add it to the example in the docs (found in Panel | style):



new Ext.Panel({
title: 'Some Title',
renderTo: Ext.getBody(),
width: 400, height: 300,
layout: 'form',
items: [{
xtype: 'textarea',
style: {
width: '95%',
marginBottom: '10px',
backgroundColor: '#CEDFF5'
}
},
new Ext.Button({
text: 'Send',
minWidth: '100',
style: {
marginBottom: '10px'
}
})
]
});



There must be something else in your panel's config/items that is affecting it.