ExtJs Ext.form.field.TextArea+Ckeditor 扩展富文本编辑器

Ext.define("MyApp.base.BaseTextArea", {
    extend: "Ext.form.field.TextArea",
    xtype: "BaseTextArea",
    
    editor: null,
    
    initComponent: function() {
        this.callParent();
        this.on("afterrender", this.handlerAfterrender);
    },
    
    handlerAfterrender: function(txa, eOpts) {
        var editor = CKEDITOR.replace(txa.getInputId());  
        CKFinder.setupCKEditor(editor,'/ckeditor/');
        txa.editor = editor;
    },
    
    getSubmitValue: function() {
        this.editor.updateElement();
        return this.callParent();
    }
});

 

posted @ 2014-02-20 13:06  大新博客  阅读(1285)  评论(0编辑  收藏  举报