简体   繁体   English

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

[英]Change title background color in ExtJS Panel

I have a two panels whose header I want to be in a different color than the default one provided by Ext JS Theme...我有两个面板,我希望其标题的颜色与 Ext JS 主题提供的默认颜色不同...

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

But it doesn't work.但它不起作用。 Also I tried to set CSS property in my styles.css but it changes only the part of the title.我还尝试在我的styles.css设置 CSS 属性,但它只更改了标题的一部分。

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

在此处输入图片说明

FIDDLE 小提琴

Here's the style:这是样式:

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

And you define the cls in panel properties:然后在面板属性中定义cls

cls: 'myCls'

Fiddle小提琴

Please use header and apply style to it:请使用标题并对其应用样式:

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

Do not need to use cls不需要使用cls

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM