代码之家  ›  专栏  ›  技术社区  ›  harunB10

在ExtJS面板中更改标题背景色

  •  1
  • harunB10  · 技术社区  · 6 年前

    我有两个面板的标题,我想在一个不同的颜色比默认的一个由extjs主题提供。。。

    items: [{
            title: 'Blacklist',
            style: {
                backgroundColor: 'red',
                backgroundImage: 'none'
            },
            padding: '5 5 5 5',
            cls: 'blackList',
            items: [
                grid
            ]
        }
    ]
    

    但它不起作用。我还尝试在我的 styles.css 但它只改变了标题的一部分。

    #panel-1091_header-title-textEl{
        background-color: black !important;
    }
    

    enter image description here

    1 回复  |  直到 6 年前
        1
  •  2
  •   beso9595 Spring boots    6 年前

    FIDDLE

    风格如下:

    .myCls .x-panel-header-default {
        background-color: green;
    }
    

    你定义了 cls 面板内属性:

    cls: 'myCls'
    
        2
  •  1
  •   Andrey Ptashinskiy    5 年前

    Fiddle

    title: 'Blacklist',
    header: {
        style: {
            backgroundColor: 'red'
        }
    },
    

    不需要使用cls