Mixin: SC.CollectionContent

This mixin provides standard methods used by a CollectionView to provide additional meta-data about content in a collection view such as selection or enabled state.

You can apply this mixin to a class that you set as a delegate or to the object you set as content.

Defined in: collection_content.js

Since:
SproutCore 1.0

Field Summary

Class Methods

Field Detail

SC.CollectionContent.isCollectionContent Boolean
Used to detect the mixin by SC.CollectionView

Class Method Detail

contentGroupIndexes(collection, content)

Optionally return an index set containing the indexes that may be group views. For each group view, the delegate will actually be asked to confirm the view is a group using the contentIndexIsGroup() method.

If grouping is not enabled, return null.

Parameters:
collection SC.CollectionView
the calling view
content SC.Array
the content object
Returns:
SC.IndexSet
contentIndexCollapse(collection, content, idx)

Called to collapse a content index item if it is currently in an open disclosure state. The default implementation does nothing.

Parameters:
collection SC.CollectionView
the collection view
content SC.Array
the content object
idx Number
the content index
Returns:
void
contentIndexDisclosureState(collection, content, idx)

Returns a constant indicating the disclosure state of the item. Must be one of SC.BRANCH_OPEN, SC.BRANCH_CLOSED, SC.LEAF_NODE. If you return one of the BRANCH options then the item may be rendered with a disclosure triangle open or closed. If you return SC.LEAF_NODe then the item will be rendered as a leaf node.

Default returns SC.LEAF_NODE.

Parameters:
collection SC.CollectionView
the collection view
content SC.Array
the content object
idx Number
the content index
Returns:
Boolean
YES, NO, or SC.MIXED_STATE
contentIndexExpand(collection, content, idx)

Called to expand a content index item if it is currently in a closed disclosure state. The default implementation does nothing.

Parameters:
collection SC.CollectionView
the collection view
content SC.Array
the content object
idx Number
the content index
Returns:
void
contentIndexIsEnabled(collection, content, idx)

Returns YES if the content index should be enabled. Default looks at the isEnabled state of the collection view.

Parameters:
collection SC.CollectionView
the collection view
content SC.Array
the content object
idx Number
the content index
Returns:
Boolean
YES, NO, or SC.MIXED_STATE
contentIndexIsGroup(collection, content, idx)

Returns YES if the item at the specified content index should be rendered using the groupExampleView instead of the regular exampleView. Note that a group view is different from a branch/leaf view. Group views often appear with different layout and a different look and feel.

Default always returns NO.

Parameters:
collection SC.CollectionView
the collection view
content SC.Array
the content object
idx Number
the content index
Returns:
Boolean
YES, NO, or SC.MIXED_STATE
contentIndexIsSelected(collection, content, idx)

Return YES if the content index should be selected. Default behavior looks at the selection property on the view.

Parameters:
collection SC.CollectionView
the collection view
content SC.Array
the content object
idx Number
the content index
Returns:
Boolean
YES, NO, or SC.MIXED_STATE
contentIndexOutlineLevel(collection, content, idx)

Returns the outline level for the item at the specified index. Can be used to display hierarchical lists.

Default always returns -1 (no outline).

Parameters:
collection SC.CollectionView
the collection view
content SC.Array
the content object
idx Number
the content index
Returns:
Boolean
YES, NO, or SC.MIXED_STATE
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)