如何在ExtJS4中更改工具栏的背景色

如何在ExtJS4中更改工具栏的背景色,extjs,background,extjs4,toolbar,Extjs,Background,Extjs4,Toolbar,我正在尝试更改工具栏的背景色。现在,我有ext经典主题。我希望工具栏背景颜色为深蓝色,但此颜色更改不应适用于所有正在创建的工具栏。有人能指导我怎么做这件事吗 提前感谢。使用cls配置 Ext.create('Ext.toolbar.Toolbar', { ..., cls: 'myBgCls', ... 然后使用css更改背景: .myBgCls{ background: blue; } 使用cls配置 Ext.create('Ext.toolbar.Tool

我正在尝试更改工具栏的背景色。现在,我有ext经典主题。我希望工具栏背景颜色为深蓝色,但此颜色更改不应适用于所有正在创建的工具栏。有人能指导我怎么做这件事吗

提前感谢。

使用cls配置

Ext.create('Ext.toolbar.Toolbar', {
    ...,
    cls: 'myBgCls',
    ...
然后使用css更改背景:

.myBgCls{
    background: blue;
}
使用cls配置

Ext.create('Ext.toolbar.Toolbar', {
    ...,
    cls: 'myBgCls',
    ...
然后使用css更改背景:

.myBgCls{
    background: blue;
}
您还可以尝试使用配置选项

Ext.define 'App.your_package.CustomToolbar',
    extend: 'Ext.toolbar.Toolbar'
    xtype: 'my-custom-toolbar'
    style: 'background-color: #112D41;'
干杯

您也可以尝试使用配置选项

Ext.define 'App.your_package.CustomToolbar',
    extend: 'Ext.toolbar.Toolbar'
    xtype: 'my-custom-toolbar'
    style: 'background-color: #112D41;'

干杯

使用工具栏的cls配置并在css中设置背景:谢谢@newmount你能为我提供一些关于如何准确完成的参考吗..因为我不熟悉使用工具栏的cls配置并在css中设置背景:谢谢@newmount你能为我提供一些关于如何准确完成的参考吗完成..因为我不熟悉使用cls配置