Collection view structure
Using collection views in Skylight
Collection View Recipe Application Bundle
The root view of the recipe consists of a card that opens the
collectionView. The root view is always created with a list structure, so we use a second view in this recipe to see how the collection view structure works.
collectionViewitself is bound to the array of items in
skylight.application.data.collectionCards. Each of these items specifies a
type, along with other possible values used by the cards when performing the data binding. The card id selector for the view is set to
typein the view's properties panel, which means that each item in the
collectionCardsarray will map to a card in the view whose id matches the
typevalue of the item.
collectionViewconsists of one card for each type. The types of the items in the
collectionCardsarray used by this recipe are:
text: The card with this id also binds to the value of the
textproperty of the item, as well as possibly the
fontSizeproperty of the item. For the latter, it defaults to
text-with-icon: The card with this id also binds to the value of the
textproperty of the item.
image-user: This card has an image of a user.
image-check: This card has an image of a check mark.
While this recipe uses an array from application data as the source of items for the collection view, other sources could be used including session and local data.