Class: Wraith.CollectionView
Defined in: | src/collectionview.coffee |
Inherits: | Wraith.ViewModel |
Overview
The CollectionView provides Collection -> View binding. It handles repeated view instances, adding and removing views when models are added or removed, and updating the corresponding view when a model changes.
Instance Method Summary
- - (void) constructor($el, template) Constructor Constructor
- - (void) createView(model) Creates a view as a child of $el using the append method.
- - (void) removeView(model) Removes a view that was bound to a given model.
- - (void) updateView(model) Updates a view that is bound to the given model.
Inherited Method Summary
Methods inherited from Wraith.ViewModel
#constructor, #render, #updateView, #bindModel, #unbindModel, #handleInputChange_, #handleFormSubmit_
Methods inherited from Wraith.BaseView
#constructor, #bindUIEvents, #bindUIEvent, #wrapUIEvent, #handleUIEvent, #unbindUIEvents, #unbindUIEvent, #applyViewUpdate, #updateAttribute
Methods inherited from Wraith.Base
#constructor, #bind, #unbind, #emit, #proxy
Constructor Details
- (void) constructor($el, template)
Constructor
Instance Method Details
- (void) createView(model)
Creates a view as a child of $el using the append method.
- (void) removeView(model)
Removes a view that was bound to a given model. Performs a lookup within the parent $el for the data-model-id=[model_id] attribute.
- (void) updateView(model)
Updates a view that is bound to the given model.