Mixin: SC.CollectionRowDelegate

CollectionRowDelegates are consulted by collection views, such as SC.ListView that lay out items in vertical or horizontal rows, in order to determine the height or width of each row.

Defined in: collection_row_delegate.js

Field Summary

Class Methods

Field Detail

Deprecated:

Version 1.11. Please use the customRowSizeIndexes property instead. Index set of rows that should have a custom row height. If you need certain rows to have a custom row height, then set this property to a non-null value. Otherwise leave it blank to disable custom row heights.

SC.CollectionRowDelegate.customRowHeightIndexes SC.IndexSet
SC.CollectionRowDelegate.isCollectionRowDelegate Boolean
Walk like a duck.
Default value:
true
Deprecated:

Version 1.11. Please use the rowSize property instead. Size of an item without spacing or padding. Unless you implement custom row height or widths upport, this row height will be used for all items.

SC.CollectionRowDelegate.itemHeight Number
Default value:
24
SC.CollectionRowDelegate.rowPadding Number

Padding space added to the top and bottom of each row when laid out vertically, or to the left and right when laid out horizontally.

This is useful if you are using a custom item view that needs to be padded.

Default value:
0
SC.CollectionRowDelegate.rowSpacing Number

The amount of space to leave between each row.

This is useful when you need to leave space for borders.

Default value:
0

Class Method Detail

Deprecated:

Version 1.11. Please use the contentIndexRowSize() function instead. Called for each index in the customRowSizeIndexes set to get the actual row height for the index. This method should return the default rowSize if you don't want the row to have a custom height.

The default implementation just returns the default rowSize.

contentIndexRowHeight(view, content, contentIndex)
Parameters:
view SC.CollectionView
the calling view
content Object
the content array
contentIndex Number
the index
Returns:
Number
row height
contentIndexRowSize(view, content, contentIndex)

Called for each index in the customRowSizeIndexes set to get the actual row size for the index. This method should return the default rowSize if you don't want the row to have a custom size.

The default implementation just returns the default rowSize plus rowPadding.

Parameters:
view SC.CollectionView
the calling view
content Object
the content array
contentIndex Number
the index
Returns:
Number
row size
customRowSizeIndexes(key, value)

Index set of rows that should have a custom row height. If you need certain rows to have a custom row height, then set this property to a non-null value. Otherwise leave it blank to disable custom row heights.

Parameters:
key
value
Deprecated:

Version 1.11. Please use a combination of rowSize and rowPadding to specify the total height or width of each row. Total row size used for calculation. Equal to rowSize + (2 *rowPadding).

rowHeight(key, value)
Parameters:
key
value
rowSize(key, value)

The height or width of a row before padding depending on whether the collection is laid out vertically or horizontally.

Unless you implement custom row size support, this value will be used for all rows.

Parameters:
key
value
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)