Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
Forked from mikecleach/gist:995782
Created May 27, 2011 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjmiller/995783 to your computer and use it in GitHub Desktop.
Save brianjmiller/995783 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: Y.bind(this.onSuccessfulLoad, this)
}
}
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