You can use the $super parameter name to access the property of the parent class.
See: http://api.prototypejs.org/language/Class/create/ On Mon, Nov 29, 2010 at 12:15 PM, Luke <[email protected]> wrote: > Hi there! > > Is there a way you can inherit from a class and extend a property from > the parent class with the same property of the subclass? Like if I > have the following 2 classes: > > === === > > var Section = Class.create({ > > attach: function(element) { > Object.extend(element, this.extension); > } > > extension: { > // Methods and properties here > } > } > > === and === > > var SectionText = Class.create(Section, { > > extension: { > // More methods and properties here > } > > }); > > === === > > is somehow possible to extend the extension-property of the parent > class with the extension-property of the subclass rather than > replacing it? Can I maybe somehow access the parent's property from > the subclass to manually extend it? > > Thanks, > Luke > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<prototype-scriptaculous%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" 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-scriptaculous?hl=en.
