Here's a quick example (based on my reading of Sencha's code; I agree that we could use more documentation here):
Code:
Ext.define('MyMainClass', {
// the benefit is that you can add to your class with one
// or more mixins, rather than by extending another class
extend: 'MyParentClass',
mixins: {
myMixinIdentifier: 'MyMixinClass'
},
constructor: function(config) {
this.callParent(arguments);
// make sure you call this if your mixin has a constructor
this.mixins.myMixinIdentifier.constructor.call(this);
}
});
Ext.define('MyMixinClass', {
extend: 'Ext.mixin.Mixin',
mixinConfig: {
id: 'myMixinIdentifier'
},
config: {
// configs defined here will be added to MyMainClass instances
}
// methods defined here will be added to MyMainClass instances
});