删除extjs自动添加的类 [英] Remove extjs automatically added classes

查看:66
本文介绍了删除extjs自动添加的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Extjs的新手.我在项目中使用Extjs 4.加载ext-all.js时,它会自动将类添加到<body>标记中.而我所有其他的CSS样式都被extjs样式更改了.我在文档中发现将Ext.scopeResetCSS属性设置为true,因此我如下添加.

    Ext.onReady(function(){
      new Ext.Component({
          scopeResetCSS: true
      });
    });

但是它没有任何改变.我仍然有同样的问题.

有什么方法可以阻止extjs自动将CSS类添加到标签中吗?请帮忙.

这是我的代码,用于生成多行消息框.

<link rel="stylesheet" type="text/css" href="components/com_jobs/js/extjs/resources/css/ext-all.css"/>
<script type="text/javascript" src="components/com_jobs/js/extjs/ext-all.js"></script>

<!-- extjs message box code -->
<script type="text/javascript">

Ext.require([
'Ext.window.MessageBox'
             ]);     

function removeBid(bidid){
    Ext.MessageBox.show({
        title: 'Address',
        msg: 'Please enter your address:',
        width:300,
        buttons: Ext.MessageBox.OKCANCEL,
        multiline: true,
        //fn: showResultText
    });
}
</script>

我做错什么了吗???我希望extjs只对自己的组件进行样式设置.但是现在extjs样式对我的整个页面都有影响.请帮助.

谢谢.

解决方案

我对ExtJS 4.2提出了类似的问题. 1,然后再碰到这个.我采用的解决方案是在ExtJS加载后修改DOM,并为DOMNodeInserted事件添加一个侦听器,以监视并处理自动创建ExtJS组件(如选择列表)的过程.如果您有兴趣,可以在这里找到我的答案: https://stackoverflow.com/a/29934347/857209

I am new to Extjs. I am using Extjs 4 in my project. When the ext-all.js is loaded it automatically adds classes to the <body> tag. and all my other css styles are changed with extjs styles. I found in the documentaion that to set Ext.scopeResetCSS property to true, so I add like below.

    Ext.onReady(function(){
      new Ext.Component({
          scopeResetCSS: true
      });
    });

but it doesn't change any thing. I still have the same problem.

Is there any way to stop extjs from automatically adding css classes to the tags? Please help..

This is my code to generate a multi line message box.

<link rel="stylesheet" type="text/css" href="components/com_jobs/js/extjs/resources/css/ext-all.css"/>
<script type="text/javascript" src="components/com_jobs/js/extjs/ext-all.js"></script>

<!-- extjs message box code -->
<script type="text/javascript">

Ext.require([
'Ext.window.MessageBox'
             ]);     

function removeBid(bidid){
    Ext.MessageBox.show({
        title: 'Address',
        msg: 'Please enter your address:',
        width:300,
        buttons: Ext.MessageBox.OKCANCEL,
        multiline: true,
        //fn: showResultText
    });
}
</script>

Am I doing anything wrong??? I want extjs to style only its own components. But now extjs styles are effects my whole page.. Please help.

Thanks.

解决方案

I asked a similar question for ExtJS 4.2.1 before coming across this one. The solution I adopted was to modify the DOM once ExtJS was loaded, and add a listener for the DOMNodeInserted event to watch for and handle the automatic creation of ExtJS components like pick lists. If you are interested you can find my answer here: https://stackoverflow.com/a/29934347/857209

这篇关于删除extjs自动添加的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆