Class: SC.TemplateCollectionView

Extends SC.TemplateView.

Defined in: template_collection.js

SproutCore 1.5

Field Summary

Instance Methods

Field Detail

content SC.Array
A list of items to be displayed by the TemplateCollectionView.
Default value:
emptyView SC.TemplateView
An optional view to display if content is set to an empty array.
Default value:
inverseTemplateName String
The name of a template to lookup if no inverse template is provided.
itemView SC.TemplateView
Default value:
itemViewTemplate Function

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.

itemViewTemplateName String

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.

tagName String

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:

Instance Method Detail

arrayContentDidChange(addedObjects, removedObjects, changeIndex)

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.

addedObjects Array
the objects that were added to the content
removedObjects Array
the objects that were removed from the content
changeIndex Number
the index at which the changes occurred
arrayContentWillChange(start, removedCount, addedCount)
inverseTemplate(key, value)
A template to render when there is no content or the content length is 0.
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:21 GMT-0600 (CST)