-
-
Save jashkenas/89405 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View Constructor: | |
this.configure(options); | |
this._reset(); | |
this.render(); | |
Base View | |
.el - conventional root element reference for every view | |
.toElement - returns this.el | |
.childViews - Array of child views | |
<optional> cleanup - calls cleanup on all child views | |
.destroy - el remove and cleanup | |
._reset - clears dom beneath the root node and calls cleanup on all childViews | |
._tagName property (optional) defaults to div | |
._klassName property (optional) added as underscored css class | |
DOM Utilities | |
.setMode - sets css class and js mode on a view...allows mode grouping | |
.attachCallbacks - create bound callbacks via css selectors | |
-- no more .get in zenview -- | |
- template should always be inserted into the views root element | |
Configurable | |
.configure - takes default_options and extends it with passed in options | |
- if a setter exists with the option key name call it with the value as arguments | |
Bindable - provides conventional hooks for model observation | |
.on[Property]Changed | |
.onModelChanged | |
.onModelAdded | |
.onModelRemoved | |
.onModelUpdated | |
.setModel - conventional way to set a model binding for a view |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment