The Collections API defines the following data types:
Item object
ItemEntry object
Item Object
An object that represents either a collection, or an item in a collection
Parameter |
Description |
---|---|
itemID |
ID of the item |
title |
Item title that is displayed in the UI, for example, in detailed navigation (DTN) or masthead |
type |
Type of collection. Can be one of the types defined below. |
tooltip (optional) |
Item tooltip. If not specified, title is used as a tooltip. |
target (optional) |
Target of the item, which is either:
|
argument (optional) |
A string argument that is passed to the callback function. Should be specified, if the target is a JavaScript callback function. |
Use the following syntax to create an item:
LSAPI.Collections.Item(itemID, title, type, tooltip, target, argument)
var optionsMenuCollection = new LSAPI.Collections.Item("myID","myTitle", LSAPI.Collections.Types.OPTIONS_MENU,"myTooltip","roles://mytarget");
ItemEntry Object
Represents an entry for adding to a collection. An entry can be either a single item, or a collection of items.
Parameter |
Description |
---|---|
item |
An Item object representing the item to add to a collection |
collectionID |
ID of a collection to which to add the specified item |
parentID (optional) |
ID of the parent item (folder item) that should contain the added item. Relevant for nested collections (currently only for menus); for other collections types, a null value is expected. |
overwrite (optional) |
Defines whether to overwrite an existing item with the same itemID or title. Default value is false. |
Use the following syntax to create an item entry:
LSAPI.Collections.ItemEntry(item, collectionID, parentID, overwrite)
Collection Types
The LSAPI.Collections.Types enumeration defines the following collection types:
LINK: a link in DTN
MENU: an item in the AFP menu bar
OPTIONS_MENU: an item in the Options menu in the masthead
INPLACE_LINK: an embedded dynamic navigation link
DYNAMIC_EXTENDED_LINKS: a floating dynamic navigation link
ACTION_BAR_ITEM: an item in the action bar of the Smartphone Framework Page and the Tablet Framework Page