我再Ext页面中镶嵌了Ckeditor插件但是在Ckeditor下面在声明的其他组件就显示不了了..请各位大侠帮助俺一把
代码是这样的:
[code="java"]
[code="java"]
Ext.form.CKEditor = function(config) {
this.config = config;
Ext.form.CKEditor.superclass.constructor.call(this, config);
};
Ext.extend(Ext.form.CKEditor, Ext.form.TextArea, {
hideLabel : true,
constructor : function(config) {
config = config || {};
config.listeners = config.listeners || {};
Ext.applyIf(config.listeners, {
beforedestroy : this.onBeforeDestroy
.createDelegate(this),
scope : this
});
Ext.form.CKEditor.superclass.constructor.call(this, config);
},
onBeforeDestroy : function() {
this.ckEditor.destroy();
},
onRender : function(ct, position) {
if (!this.el) {
this.defaultAutoCreate = {
tag : "textarea",
autocomplete : "off"
};
}
Ext.form.TextArea.superclass.onRender.call(this, ct, position);
this.ckEditor = CKEDITOR.replace(this.id, Ext.apply({
skin : 'office2003'
}, this.config.CKConfig));
},
setValue : function(value) {
if (Ext.isEmpty(value)) {
value = "";
}
Ext.form.TextArea.superclass.setValue.apply(this, [value]);
CKEDITOR.instances[this.id].setData(value);
},
getValue : function() {
CKEDITOR.instances[this.id].updateElement();
this.value = CKEDITOR.instances[this.id].getData();
return Ext.form.TextArea.superclass.getValue.apply(this);
},
getRawValue : function() {
CKEDITOR.instances[this.id].updateElement();
this.value = CKEDITOR.instances[this.id].getData();
return Ext.form.TextArea.superclass.getRawValue.apply(this);
}
});
Ext.reg('ckeditor', Ext.form.CKEditor);
[/code]
使用
[code="java"]
new Ext.form.CKEditor({
xtype : 'ckeditor',
name : 'content',
width : '100%',
height : 250
});
[/code]