[solucionado]ckeditor y extjs
Alguno sabe como implementar el nuevo ckeditor con extjs he probado un plugin del foro de extjs <!-- m -->http://www.extjs.com/forum/showthread.php?t=79031<!-- m -->
pero no funcionan los getvalue etc.
me contesto a mi mismo <!-- s;) --><!-- s;) -->.
He creado uno con distinto codigo y fuciona. Os lo pongo por si os sirve y tmb por si veis algún fallo y asi me avisais <!-- s;) --><!-- s;) -->
el archivo se llama Ext.ux.CKeditor
y el codigo:
Ext.ns('Ext.ux');
Ext.ux.CKeditor = Ext.extend(Ext.form.TextArea,{
initComponent: function(){
Ext.ux.CKeditor.superclass.initComponent.apply(this, arguments);
},
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.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();
var value=CKEDITOR.instances[this.id].getData();
Ext.form.TextArea.superclass.setValue.apply(this,[value]);
return Ext.form.TextArea.superclass.getValue.apply(this);
},
getRawValue : function(){
CKEDITOR.instances[this.id].updateElement();
return Ext.form.TextArea.superclass.getRawValue(this);
}
});
Ext.reg('ckeditor', Ext.ux.CKeditor);
para llamarlo desde la aplicación:
{
xtype: 'ckeditor',
fieldLabel: 'Texto',
itemId:'texto',
name: 'texto',
CKConfig: {
customConfig : '/ckeditor/config.js',
skin : 'office2003',
resize_enabled:false,
width:"70%",
height : 200
}
}
y
this.componente.getComponent('texto').getValue()
¿Conoces a alguien que pueda responder esta pregunta? Comparte el link en Twitter o Facebook
Es necesario registrarse para poder participar en el foro! Si ya tienes una cuenta puedes entrar y comentar en este foro.
