PDA

View Full Version : Ext.extend



Bleak
8 Feb 2010, 4:38 PM
Does the Ext.extend only apply if you are trying to extend the base functionality of an Ext component?

The reason I ask, is that I am trying to create the concept of an abstract class within JavaScript, the extending classes will probably always use Ext.someComponent but I'm not always sure which one it will be? This seems to make it a challenge since the importance of calling the superclass during the initiation of the implementing class.

Hopefully this makes sense!

Thanks,
Dean.

evant
8 Feb 2010, 4:40 PM
Do you mean can you make classes that don't derive from Ext.Component? If so:



MyClass = Ext.extend(Object, {
constructor : function(){
console.log('ctor');
}
});
var c = new MyClass();

Bleak
8 Feb 2010, 5:09 PM
Thanks, that worked perfectly. Always seems so obvious when you first see it!

Thanks,
Dean.