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