PDA

View Full Version : superclass and constructor properties: added in Ext.extend()?



charris
8 Sep 2010, 11:01 AM
Pardon the ignorance, but "superclass" and "constructor" are convenience properties that Ext.extend() adds to an object, correct?

I'm new to Ext JS and am trying to fully understand how calls to superclass constructors work, as shown in several examples like this:


MyNewClass = function(arg1, arg2, etc) {
// explicitly call the superclass constructor
MyNewClass.superclass.constructor.call(this, arg1, arg2, etc);
};

Thanks!

Animal
8 Sep 2010, 12:47 PM
Correct. Ext.extend adds these references for you.

superclass is a reference to the superclass's prototype which contains the shared references (usually methods) of that class.