Wangyc_92 2017-02-17 08:59 采纳率: 0%
浏览 1145

关于Extjs与ckeditor整合

求大神帮帮忙~
小弟感激不尽~
用的是ckeditor 4.6.2
注册控件
Ext.common.CKeditor = function(config){
this.config = config;
Ext.common.CKeditor.superclass.constructor.call(this, config);
};
 
Ext.extend(Ext.common.CKeditor, Ext.form.TextArea,  {
    onRender : function(ct, position){
if(!this.el){
this.defaultAutoCreate = {
tag: "textarea",
autocomplete: "off"
};
}
Ext.form.TextArea.superclass.onRender.call(this, ct, position);
CKEDITOR.replace(this.id, this.config.CKConfig);
    },
     
    setValue : function(value){
        Ext.form.TextArea.superclass.setValue.apply(this,[value]);
        CKEDITOR.instances[this.id].setData(value);
    },
 
    getValue : function(){
CKEDITOR.instances[this.id].updateElement();
return Ext.form.TextArea.superclass.getValue.call(this);

    },
 
    getRawValue : function(){

CKEDITOR.instances[this.id].updateElement();
return Ext.form.TextArea.superclass.getRawValue.call(this);
    }
});
Ext.reg('ckeditor', Ext.common.CKeditor);

创建控件
var articleContent = new Ext.common.CKeditor({
fieldLabel: '文章内容',
id: 'articleContent',
name: 'articleContent',
width: 740,
height: 200
});

但是在向编辑框中写入数据的时候总是没有效果,result.content是在后台取到的数据,现在向后台存文本是没有问题的,就是显示不出来。
Ext.getCmp('articleContent').setValue(result.content);
  • 写回答

1条回答 默认 最新

  • dabocaiqq 2017-02-17 20:58
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作