Skip to content

Instantly share code, notes, and snippets.

@sergi
Created January 15, 2010 18:19
Show Gist options
  • Save sergi/278283 to your computer and use it in GitHub Desktop.
Save sergi/278283 to your computer and use it in GitHub Desktop.
function Test(cfg) {
Test.superclass.constructor.apply(this, arguments);
this.initializer(cfg);
};
Y.extend(Test, Y.Base, {
initializer: function(config) {
this.addAttrs({
items: {
value: []
},
}, config);
Y.on("itemsChange", this.doSomething);
items.push("item1");
},
doSomething: function(e) {
Y.log("items have been changed!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment