简体   繁体   English

按钮上的overCls在ExtJS中不起作用

[英]overCls on a button does not work in ExtJS

My button 我的按钮

         [...]
         {
            xtype: 'button',
            overCls: 'test1',
            text: 'Référentiels',
            scale: 'medium',
            margin: '5 0 5 0',
            menu: [{
                text: 'Import',
                iconCls: 'importIcon',
                listeners: {
                    click: Import
                }
            }, {
                text: 'Consultation',
                iconCls: 'searchIcon',
                listeners: {
                    click: Consultation
                }
            }]
        }, [...]

and my CSS : 和我的CSS:

.test1
{
background: #ffb76b; /* Old browsers */
background: -moz-linear-gradient(top,  #ffb76b 0%, #ffa73d 50%, #ff7c00 51%, #ff7f04      100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffb76b),  color-stop(50%,#ffa73d), color-stop(51%,#ff7c00), color-stop(100%,#ff7f04)); /*   Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #ffb76b 0%,#ffa73d 50%,#ff7c00 51%,#ff7f04 100%);  /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #ffb76b 0%,#ffa73d 50%,#ff7c00 51%,#ff7f04 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #ffb76b 0%,#ffa73d 50%,#ff7c00 51%,#ff7f04 100%); /* IE10+ */
background: linear-gradient(to bottom,  #ffb76b 0%,#ffa73d 50%,#ff7c00 51%,#ff7f04 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffb76b', endColorstr='#ff7f04',GradientType=0 ); /* IE6-9 */
}

However, this is not working. 但是,这不起作用。 When the button is hovered, the CSS class is applied (I can see it in the console, x-btn-test1 instead of x-btn-over, etc) but it does not display on the button. 悬停按钮时,将应用CSS类(我可以在控制台中看到它,使用x-btn-test1而不是x-btn-over等),但是它不会显示在按钮上。

I tried with !important, same problem. 我尝试了!important,同样的问题。

If I apply my css directly with 如果我直接将CSS应用于

cls: test1

it's working. 它正在工作。

Thanks for tips ! 感谢您的提示!

It seems that the framework auto-appends the "x-" prefix to your overCls class name; 似乎该框架会自动在您的overCls类名后面加上“ x-”前缀。 add the prefix "x-" to your class name, that should solve the problem, like this, 您的课程名称中添加前缀“ x-”,即可解决该问题,例如,

.x-test1 {....}

You can see a working sample here . 您可以在此处看到一个工作示例 Hope it helps. 希望能帮助到你。

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

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