Mixin: SC.CollectionRowDelegate
CollectionRowDelegate
s 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
- SC.CollectionRowDelegate.customRowHeightIndexes Deprecated
- SC.CollectionRowDelegate.isCollectionRowDelegate
- SC.CollectionRowDelegate.itemHeight Deprecated
- SC.CollectionRowDelegate.rowPadding
- SC.CollectionRowDelegate.rowSpacing
Class Methods
- contentIndexRowHeight(view, content, contentIndex) Deprecated
- contentIndexRowSize(view, content, contentIndex)
- customRowSizeIndexes(key, value)
- rowHeight(key, value) Deprecated
- rowSize(key, value)
Field Detail
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.
- Default value:
- true
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.
- Default value:
- 24
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
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
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
.
- Parameters:
- view SC.CollectionView
- the calling view
- content Object
- the content array
- contentIndex Number
- the index
- Returns:
- Number
- row height
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
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
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)
.
- Parameters:
- 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