Class: SC.TemplateCollectionView
Extends
SC.TemplateView.
Defined in: template_collection.js
- Since:
- SproutCore 1.5
Field Summary
- Fields borrowed from SC.TemplateView:
- templateName, templates
- Fields borrowed from SC.CoreView:
- isAttached, isVisibleInWindow, viewState
Instance Methods
- arrayContentDidChange(addedObjects, removedObjects, changeIndex)
- arrayContentWillChange(start, removedCount, addedCount)
- didCreateLayer()
- invalidateFrame()
- inverseTemplate(key, value)
- itemTagName()
- itemViewClass()
Field Detail
content SC.Array- Default value:
- null
- Default value:
- null
- Default value:
- SC.TemplateView
The template used to render each item in the collection.
This should be a function that takes a content object and returns a string of HTML that will be inserted into the DOM.
In general, you should set the itemViewTemplateName
property instead of
setting the itemViewTemplate
property yourself. If you created the
SC.TemplateCollectionView
using the Handlebars {{#collection}} helper, this
will be set for you automatically.
The name of the template to lookup if no item view template is provided.
The collection will look for a template with this name in the global
SC.TEMPLATES
hash. Usually this hash will be populated for you
automatically when you include .handlebars
files in your project.
Name of the tag that is used for the collection
If the tag is a list ('ul' or 'ol') each item will be wrapped into a 'li' tag. If the tag is a table ('table', 'thead', 'tbody') each item will be wrapped into a 'tr' tag.
- Default value:
- ul
Instance Method Detail
Called when a mutation to the underlying content array occurs.
This method will replay that mutation against the views that compose the
SC.TemplateCollectionView
, ensuring that the view reflects the model.
This enumerable observer is added in contentDidChange
.
- Parameters:
- start
- removedCount
- addedCount
- Parameters:
- key
- value