I just went to http://clientside.cnet.com/wiki/ and ran this in the console:

var Foo = new Class({ 
    Implements: Options, 
    options: { 
       fruits: { 
         apple: 'red', 
         orange: 'orange' 
       }, 
       favoriteNumber: 10 
    }, 
    initialize: function(options){ 
        this.setOptions(options); 
    } 
}); 

var Bar = new Class({ 
    Extends: Foo,
    options: { 
        fruits: { 
            apple: 'green', 
            lemon: 'yellow' 
        }, 
        favoriteNumber: 12, 
        favoriteColor: 'blue' 
    }, 
    initialize: function(options){ 
        this.parent(options); //sets options 
        console.log(this.options.fruits.apple); //logs 'green' 
        console.log(this.options.fruits.orange); //logs null 
    } 
}); 
new Bar();
//logged green, then orange

Works for me. If it's not working for you, then I don't know what to tell
you.

-----
The MooTools Tutorial:  http://www.mootorial.com www.mootorial.com 
CNET Clientside:  http://clientside.cnet.com clientside.cnet.com 
-- 
View this message in context: 
http://n2.nabble.com/Extending-a-class.-tp1095871p1097139.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to