Search code examples
javascriptextjsextjs4extjs5

Cannot read property 'removeCls' of null for tagfield in ExtJS 5


I'm upgrading my ExtJs application form 4 to 5.1 . Initially I was using boxselect component from UX, but in ExtJS 5.1 this component come in core Ext directory. So I removed boxselect and replaced with tagfield as said in up gradation guide. But after doing this I start getting this error

Uncaught TypeError: Cannot read property 'removeCls' of null.

If I rename tagfield with combo it work without any error.

I am changing xtype : '' only, nothing else, don't know exactly what else I missing in upgrading boxselect to tagfield in extjs 5 ?

Edit -: After debuging more I found problem in toggleInvalidCls() method from Ext.form.field.Text..Please find code bellow,

toggleInvalidCls: function(hasError) {
    var method = hasError ? 'addCls' : 'removeCls';
    this.callParent();
    this.triggerWrap[method](this.triggerWrapInvalidCls);//getting error here
    this.inputWrap[method](this.inputWrapInvalidCls);
},

this.triggerWrap object coming null for tagfield...any reason ? Brwoser console also showing warning XTemplate evaluation exception: wrapperStyle is not defined before throwing error of removeCls...


Solution

  • Got problem with my combo override.Just removed existing combo override, now able to show tagfield.

    I have forgot that I have combo override in my application.

    Remember - If you are using tagifled with your existing combo override consider it while upgrading extjs 5 with tagfield.