Skip to content

Instantly share code, notes, and snippets.

@apipkin
Created August 27, 2012 20:24
Show Gist options
  • Select an option

  • Save apipkin/3491970 to your computer and use it in GitHub Desktop.

Select an option

Save apipkin/3491970 to your computer and use it in GitHub Desktop.
YUI.add(NAME, function(Y){
Y.MyWidget = Y.Base.create(NAME, Y.Widget, [], {
initializer: function() {
// set up anything initially that's not handled with the config
},
destructor: function() {
// tear down any thing that needs it
// dom and dom events will be detached automatically
},
renderUI(): function() {
// build HTML
// attach to this.get('contentBox')
},
bindUI(): function() {
// event listeners for internal use
// this.after('attrNameChange', this._afterAttrNameChange, this)
// this.get('boundingBox').delegate('click', this._onClick, '*', this)
},
syncUI(): function() {
// sycronize the ui with anything that needs it after
// building and binding
// call this to update the markup if needed not renderUI() again
}
}, {
ATTRS: {
}
});
}, '@VERSION@', { requires: [] });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment