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



 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值