mercredi 19 mars 2014

TypeError: fn is undefined issue when user clicks in htmleditor field

I'm relatively new to ExtJS. I've written a reusable component for an htmleditor. Basically, my application has a number of comment fields and instead of writing ten different comment fields I created a reusable component that I can create dynamically. It seems to be working fine and I can click in the field and type text without an issue. However, every time I click into the field to type I get this error:



TypeError: fn is undefined



Here is my htmleditor component:



/**

* @class Stars.view.request.CommentsForm

* @extends Ext.container.Container

* Form for comments. . .nnkay?

*/

Ext.define('Stars.view.request.CommentsForm', {

extend: 'Ext.form.field.HtmlEditor'

, alias : 'widget.request_comments_form'

, height : 287

, width : 400

, initComponent : function() {

Ext.apply( this, {

grow : true

, height : this.height

, width : this.width

, border : false

, name : 'comments'

, allowBlank : true

, anchor : '98%'

, enableSourceEdit : false

, enableColors : false

, enableFont : false

, enableFontSize : false

});





this.callParent(arguments);





}

});



Here is an example of how I'm adding it to a dynamic form:



var form_panel = form.down('panel');

//build comments field

var comments_field = Ext.create('Stars.view.request.CommentsForm', {

width : 320

, height : 25

, margin : '0 0 5 5'

, enableLists : false

});

//add comments field to panel

form_panel.insert( comments_field );



Is there anything inherently wrong with how I'm doing this that would lead to this error? I originally was using Ext.widget to create this comments editor but decided to use Ext.create instead. The error still shows up. If there is something obvious I've done incorrectly I'd love to know. Thanks!




Aucun commentaire:

Enregistrer un commentaire