extjs extjs3 extjs4 htmleditor 引入自定义样式

来源:互联网 发布:c 窗口编程 编辑:程序博客网 时间:2024/05/07 09:44

想给 extjs3  的文本编辑框引入 自定义的样式,搜索无果,自己琢磨着给弄了出来,废话就不多说了,有兴趣的看下面代码:

xtype: 'htmleditor',//引用自定义样式getDocMarkup: function () {return '<html><head><link href="style/apiContent.css" rel="stylesheet" type="text/css" /></head><body></body></html>';},html:'<div class="content">****</div>'

好了,我要的效果实现了。接下来,我给大家对比一下重写的函数:

3.0版本

getDocMarkup : function(){        return '<html><head><style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>';    },

4.0版本

    getDocMarkup: function() {        var me = this,            h = me.iframeEl.getHeight() - me.iframePad * 2;        return Ext.String.format('<html><head><style type="text/css">body{border:0;margin:0;padding:{0}px;height:{1}px;cursor:text}</style></head><body></body></html>', me.iframePad, h);    },



 

 

 

原创粉丝点击