Results 1 to 4 of 4

Thread: Set background color of a FieldSet

  1. #1
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    44
    Answers
    3

    Default Answered: Set background color of a FieldSet

    Hello,

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

    Code:
    .noteopen {
        background-color: #ffe2e2; !important
        color: #900; 
    }
    Then i tried to use it on the field set as
    Code:
    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.

  2. 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!


  3. #2
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    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!


  4. #3
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    44
    Answers
    3

    Default

    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:
    Code:
    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.
    Code:
    {
                                                        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

  5. #4
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Excellent, glad you got it to work!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •