Skip to content

Instantly share code, notes, and snippets.

@mikecleach
Created May 27, 2011 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikecleach/995782 to your computer and use it in GitHub Desktop.
Save mikecleach/995782 to your computer and use it in GitHub Desktop.
Y.namespace('tnsg5').Tile = Y.Base.create("tile", Y.Widget,[], {
initializer: function () {
this.dataSource = this.getDataSourceInstance();
var dsCfg = {
request: "cb={}",
callback: {
//HERE IS WHERE THE FUNCTION IS ADDED
success: this.onSuccessfulLoad
}
}
this.dataSource.sendRequest(dsCfg);
},
onSuccessfulLoad: function (e) {
var that = this;
//ERROR! How do I get this to refer to the class instance?
that.tileNode.one('.tileTitle').set('text', e.data.title);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment