0

If I define an extjs class and i want to say addEvents inside the initComponent, is it mandatory that the class extend the Ext.util.Observable?

Victor
  • 16,609
  • 71
  • 229
  • 409

1 Answers1

2

No, Observable is now a mixin, so you can use:

Ext.define('MyClass', {
    extend: 'SomeOtherClass',
    mixins: ['Ext.util.Observable']
}) 
Amit Aviv
  • 1,816
  • 11
  • 10
  • Thanks. Can you give a brief idea about what is the use of Mixins? I read the sencha docs http://www.sencha.com/learn/sencha-class-system but the part on mixins was not clear. i.e what is the benefit of mixin? – Victor Jun 14 '13 at 18:09
  • I'm not sure I can write it better than [this answer](http://stackoverflow.com/questions/7506210/whats-the-difference-between-mixin-and-extend-in-javascript-libraries).. – Amit Aviv Jun 14 '13 at 19:10