PDA

View Full Version : Set background color of a FieldSet



aga@eofbof.it
14 Jan 2015, 8:34 AM
Hello,

i have a field set and i'd like to change its background color.
I defined in a css the following item



.noteopen {
background-color: #ffe2e2; !important
color: #900;
}


Then i tried to use it on the field set as


cls: 'noteopen'


but it doesn't work.
Have someone of you succeed to change background color of a field set item in extjs?

Thanks in advance.

joel.watson
14 Jan 2015, 2:20 PM
Hi--

It seems to be working for me. Can you review the Fiddle below and see if that's what you're after?

If you can't get it to work, can you let me know which version of Ext JS you're using?

Thanks!

gg2

aga@eofbof.it
15 Jan 2015, 12:20 AM
Thanks for the support.
Actually, it doesn't work and i can't understand why.

I took a look at your code and test it on the "preview" tab and it seems to work well. It's clear.

But it does not work on my project. I am using sencha architect 3 with extjs version 4.2

my code is:


Ext.define('Myapp.view.Notes', {
extend: 'Ext.form.Panel',

requires: [
'Ext.form.FieldSet',
'Ext.form.Panel',
'Ext.form.field.TextArea'
],

height: 247,
width: 692,
layout: 'fit',
bodyPadding: 10,
header: false,
title: 'My Form',

initComponent: function() {
var me = this;

Ext.applyIf(me, {
items: [
{
xtype: 'fieldset',
cls: 'noteopen',
title: 'Note',
items: [
{
.....


notice that i have also other definitions in the css file and it works with other component. I mean, i defined some css for buttons and some css for row grid colors and it works.
Hence, it can't be a problem of path.
I am really wondering what's wrong.


--------------------------------------------------------------
edit:

i tried also with an empty fieldset and it still doesn't work.


{
xtype: 'fieldset',
cls: 'noteopen',
height: 187,
title: 'My Fields'
}


------------------------------------------------------
I solve my problem. There was an error in the css file.
Indeed, what you wrote works.

thanks

joel.watson
15 Jan 2015, 5:59 AM
Excellent, glad you got it to work!