`
dowhathowtodo
  • 浏览: 777851 次
文章分类
社区版块
存档分类
最新评论

extjs extjs3 extjs4 htmleditor 引入自定义样式

 
阅读更多

想给 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);
    },



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics