首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

extjs4与FCKeditor调整

2013-11-26 
extjs4与FCKeditor整合EXTJS4与FCKeditor整合:1.自定义CKeditor控件,继承自textAreaExt.define(Ext.ux.fo

extjs4与FCKeditor整合
   EXTJS4与FCKeditor整合:
  1.自定义CKeditor控件,继承自textArea

Ext.define('Ext.ux.form.CkEditor', {    extend: 'Ext.form.field.TextArea',    alias: 'widget.ckeditor',    onRender : function(ct, position){        if(!this.el){            this.defaultAutoCreate = {                tag: "textarea",                autocomplete: "off"            };        }        this.callParent(arguments);        this.editor = CKEDITOR.replace(this.inputEl.id, this.CKConfig);    },    setValue: function(value) {        if(this.editor){            this.editor.setData(value);        }        this.callParent(arguments);    },    getValue: function() {        if (this.editor) {            this.editor.updateElement();            return this.editor.getData();        } else {            return '';        }    },    getRawValue: function() {        if (this.editor) {            this.editor.updateElement();            return this.editor.getData();        } else {            return '';        }    }});


2,像其他控件一样使用
var items = [            hiddenId,            {                xtype:'textfield',                name:'title',                layout:'form',                fieldLabel:'title',                labelWidth:50,                columnWidth:.2,                labelAlign:'right'            },            {                xtype: 'ckeditor',                fieldLabel: 'content',                labelAlign: 'left',                name: 'content',                allowBlank: true,                CKConfig: {                    height: '300',                    //如果选择字体样式等的弹出窗口被当前window挡住,就设置这个为一个较大的值                    baseFloatZIndex: 99999,                    //图片和flash都上传到这里                    filebrowserUploadUrl: '/upload'                }            }        ];

3,取值和以前一样取法,request.getPrameter("content");
   设置值也和其他的一样,
        this.down('ckeditor').setValue(jsonObj.content);

热点排行
Bad Request.