您的位置:首页 > 产品设计 > UI/UE

extjs3.4集成ueditor将ueditor封装

2015-06-01 10:26 423 查看
Ueditor.js

Ueditor = Ext.extend(Ext.form.Field ,{
id : 'editor',
defaultAutoCreate : {tag: 'div'},
constructor : function(cfg){
Ext.apply(this,cfg);
this.listeners = {
render : function(cmp) {
var ueditor = new UE.ui.Editor({zIndex:10000,initialFrameWidth:"100%",/*initialFrameHeight : 205,*/});
this.ueditor = ueditor;
ueditor.render(cmp.id);
if(this.originalValue){
var v = this.originalValue;
ueditor.ready(function(){
ueditor.setContent(v);
});
}
},
scope : this
};

Ueditor.superclass.constructor.call(this);
},
/**
* 重写setValue方法 主要为修改设置值
* */
setValue : function(value){
if(!this.ueditor){
this.originalValue = value;
}else{
this.ueditor.setContent(value);
}
}
});

调用方法:
new Ueditor({
allowBlank : true,
name : 'content',
anchor : '99%',
height : 205,
fieldLabel : ''
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  extjs ueditor