AbstractCollectionView

AbstractCollectionView ⇐ RenderedView

Kind: global abstract class
Extends: RenderedView

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

ParamTypeDescription
dataListModel.<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 MListView.selectionChange event

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

ParamTypeDescription
indexnumber

The index of the item to focus

[options]Object
[options.skipNotify]boolean

If true do not fire the MListView.selectionChange event

[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

ParamTypeDescription
itemDataObject

Data to fill item view

indexNumber

Index of current item in data collection

dataCollectionObject

Full data collection

optionsObject

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

ParamTypeDescription
indexnumber

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

ParamTypeDescription
indexnumber

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