AbstractCollectionView
On this page
AbstractCollectionView ⇐ RenderedView
Kind: global abstract class
Extends: RenderedView
- AbstractCollectionView ⇐
RenderedView- new AbstractCollectionView()
- .setData(data, [options])
- .selectItem(index, [options]) ⇒
boolean - .itemFactory(itemData, index, dataCollection, options) ⇒
*|Object - .getItem(index) ⇒
* - .getItemView(index) ⇒
View - .next() ⇒
boolean - .previous() ⇒
boolean - ._getFirstView() ⇒
View - ._getLastView() ⇒
View
AbstractCollectionView()
Abstract class to define collection view API
setData(data, [options])
Set the data
IMPORTANT setItems remove previously created items, as well as their states & transitions
Kind: instance method of AbstractCollectionView
| Param | Type | Description |
|---|---|---|
| data | ListModel.<object> | the data model of the items |
| [options] | Object | additional options |
| [options.index] | number | the item index to focus |
| [options.skipNotify] | boolean | If true do not fire the |
selectItem(index, [options]) ⇒ boolean
Select the item by it’s index Will focus related item view if parent is focused, if not states selected will be added to item view
Kind: instance method of AbstractCollectionView
Returns: boolean - Returns true if the item has been focused, false else ; If the item is already focused, return false
| Param | Type | Description |
|---|---|---|
| index | number | The index of the item to focus |
| [options] | Object | |
| [options.skipNotify] | boolean | If true do not fire the |
| [options.skipTransitions] | boolean | If true do not play the transitions |
| [options.force] | boolean | If true force the selectItem even if the index to set is already the current index |
itemFactory(itemData, index, dataCollection, options) ⇒ * | Object
Build the child view description from item data
Kind: instance abstract method of AbstractCollectionView
Returns: * | Object - Object definition for child view
| Param | Type | Description |
|---|---|---|
| itemData | Object | Data to fill item view |
| index | Number | Index of current item in data collection |
| dataCollection | Object | Full data collection |
| options | Object | Options to path through |
getItem(index) ⇒ *
Get the item data at the given index. Return the current focused item if no index is given.
Kind: instance method of AbstractCollectionView
Returns: * - Returns the item at the given index
| Param | Type | Description |
|---|---|---|
| index | number | The index of the item you want |
getItemView(index) ⇒ View
Get the item view at the given index. Return the current focused item view if no index is given.
Kind: instance method of AbstractCollectionView
Returns: View - Returns the item view at the given index
| Param | Type | Description |
|---|---|---|
| index | number | The index of the view you want |
next() ⇒ boolean
Focus the next item.
Kind: instance method of AbstractCollectionView
Returns: boolean - Returns true if the next item is focused, false else (out of bound)
previous() ⇒ boolean
Focus the previous item.
Kind: instance method of AbstractCollectionView
Returns: boolean - Returns true if the previous item is focused, false else (out of bound)
_getFirstView() ⇒ View
Get the first view of the collection.
Kind: instance method of AbstractCollectionView
Returns: View - the current first item view
_getLastView() ⇒ View
Get the last view of the collection.
Kind: instance method of AbstractCollectionView
Returns: View - the current last item view