Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/459.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 按钮上的覆盖在ExtJS中不起作用_Javascript_Css_Extjs_Extjs4 - Fatal编程技术网

Javascript 按钮上的覆盖在ExtJS中不起作用

Javascript 按钮上的覆盖在ExtJS中不起作用,javascript,css,extjs,extjs4,Javascript,Css,Extjs,Extjs4,我的纽扣 [...] { xtype: 'button', overCls: 'test1', text: 'Référentiels', scale: 'medium', margin: '5 0 5 0', menu: [{ text: 'Import',

我的纽扣

         [...]
         {
            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
                }
            }]
        }, [...]
还有我的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 */
}
然而,这是行不通的。 当按钮悬停时,会应用CSS类(我可以在控制台中看到它,x-btn-test1而不是x-btn-over,等等),但它不会显示在按钮上

我试过了!同样重要的问题

如果我直接用

cls: test1
它起作用了


谢谢你的提示

似乎框架会自动将“x-”前缀附加到您的overCls类名中在类名中添加前缀“x-”,这样可以解决问题,如下所示

.x-test1 {....}

你可以看到一个。希望有帮助。

我还发现了另一个问题,也许你也能帮我。在向按钮添加id时,不会应用cls、overCls等。只是尝试了一下,设置一个id似乎不会影响结果,可能您对该特定id有一些css规则?嗯,似乎没有,我会尝试找出原因。谢谢:)