Members
Methods
(static) create(cfg) → {Document}
Generates a menu from the configuration obejct.
Parameters:
Name | Type | Description |
---|---|---|
cfg |
Object
|
Menu related configurations |
Returns:
- Type:
-
Document
The created menu document
Example
ATV.Menu.create({
attributes: {},
items: [{
id: 'search',
name: 'Search',
page: SearchPage
}, {
id: 'homepage',
name: 'Home',
page: HomePage,
attributes: {
autoHighlight: true // auto highlight on navigate
}
}, {
id: 'movies',
name: 'Movies',
page: MoviesPage
}, {
id: 'tvshows',
name: 'TV Shows',
page: TVShowsPage
}]
});
(static) get() → {Document}
Returns instance of the menu document (auto create if not already created)
Returns:
- Type:
-
Document
Instance of the created menu document.
(static) getErrorMessage() → {String}
Get the menu error message if provided in the config
Returns:
- Type:
-
String
Error message
(static) getLoadingMessage() → {String}
Get the menu loading message if provided in the config
Returns:
- Type:
-
String
Loading message
(static) setDocument(doc, menuItemid)
Associate a document to the menuitem (using the menuitem's unique id).
Parameters:
Name | Type | Description |
---|---|---|
doc |
Document
|
The document to associate with the menuitem |
menuItemid |
String
|
The id of the menu item as per the configuration |
(static) setOptions(cfg)
Sets the default menu options
Parameters:
Name | Type | Description |
---|---|---|
cfg |
Object
|
The configuration object |