Hello,
Many times there's a need to call the parent method from the extended
class object.
This can be done easily by adding the $parent to be used inside
Object.extend() method.
***************************
var A = Class.create();
A.prototype = {
show: function() {
alert("I am A");
}
};
var $parent = Object.clone(A.prototype);
for (var i in $parent) alert(i+":\n"+$parent[i]);
Object.extend(A,{
show: function() {
$parent.show();
alert("I am EXTENDED A");
}
});
A.show();
***************************
Is there a way to make $parent variable a pre-defined variable for
every call to Object.extend() ?
-thanks, Eli
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---