Search code examples
javascriptextjsextjs4

Extjs4 Creating a mixin


Im trying to create a mixing for Ext.grid.Panel components. This is how I have attempted to do it:

Ext.define('myMixin', {
    myFunc:function(){
        console.log('completed!');
    }
});

Ext.grid.Panel.mixin('newmixin','myMixin');

The result of this is a mixin has been added to grid components, but the value is undefined. Hopefully I have missed something simple, but some help would be much appreciated.


Solution

  • I have solved the problem, but im still not 100% sure of the reason. If somebody can explain im more than happy to mark them as the answer.

    I did the following:

    Ext.grid.Panel.mixin('newmixin',Ext.define('myMixin', {
        myFunc:function(){
            console.log('completed!');
        }
    }));