css - 更改工具栏中的按钮背景颜色

标签 css button extjs4 background-color toolbar

我想更改工具栏中按钮的背景颜色。 我需要此按钮来显示摘要值。

我试过

cls: 'button-matching-auto', 

在css文件中

.x-btn-button .button-matching-auto {
    background-color: #10E0E0;
}

没有效果。

然后我尝试了

style: {color:'red'}, 

一样的:没有影响

我可以在 chrome 的开发者工具中看到应用了颜色, 但不可见。

怎么了?

最佳答案

“这是因为按钮有一个名为‘x-button’的 CSS 类,默认情况下背景颜色设置为‘#CCC’...” http://www.sencha.com/forum/showthread.php?208417-Change-image-button

{
xtype: 'button',
baseCls: 'null',
cls: 'buttonRed
}

...如果您只想要按钮的默认外观而不是灰色按钮...

我这样做是为了更改外观以获得默认外观:

dockedItems: [{
        xtype: 'toolbar',
        layout: {
            pack: 'center'
        },
        defaultButtonUI: 'default', // get default look and feel
        dock: 'bottom',
        items: [{
            xtype: 'button',
            width: 200,           
            text: 'Download to Excel',

        },{
            xtype: 'button',
            width: 200,           
            text: 'Another action',

        }]

关于css - 更改工具栏中的按钮背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20474978/

相关文章:

html - 在不影响输出结果的情况下从 html 元素替换 Display flex(不适用于 IE)

android - 如何从小部件启动对话框?

javascript - 单击按钮后启动 javascript 提示符

HTML/CSS : YouTube iframe as background with controls usable and button overlay

javascript - Ext.EventManager 在 ExtJS 5 中被弃用

css - 使用类在 CSS 中设置样式

javascript - 使侧边栏可在拖动时调整大小

html - 电子邮件模板中的边框半径替代方案

javascript - ExtJs:最佳列表组件?网格的功能太多了

javascript - 在可编辑网格中,如何使Ext组合框在选择项目时立即结束编辑模式?