JSMenuDatasource

Overview

JSMenuDataSource facilitates interaction with menu-related data by offering methods to manage and retrieve menu datasources and their structures. It supports accessing the MenuFoundSet, which represents all menu items in a fully loaded shared foundset, making it readily available for use once requested. This foundset can be used to navigate and interact with the menu data programmatically.

The datasource string of a menu can be retrieved as needed, allowing it to be referenced in various operations. Additionally, JSMenuDataSource provides functionality to handle hierarchical menus by enabling access to the relation name that defines parent-to-children relationships. This capability is essential for constructing and navigating nested menu structures effectively.

For more details, refer to the MenuFoundSet documentation.

Methods Summarized

Type
Name
Summary

Get the datasource string.

Returns the MenuFoundSet for this menu datasource.

Get relation name that allows to load child menu items

Methods Detailed

getDataSource()

Get the datasource string.

Returns: String String datasource

Sample

datasources.menu.mymenu.getDataSource() // returns 'menu:mymenu'

getFoundSet()

Returns the MenuFoundSet for this menu datasource. The menu foundset is always a shared foundset which is fully loaded will all menu items. The foundset will be completely created when is first requested.

Returns: JSFoundSet A new MenuFoundSet for the datasource.

Sample

var fs = datasources.menu.mymenu.getFoundSet()

getParentToChildrenRelationName()

Get relation name that allows to load child menu items

Returns: String String relationName

Sample

datasources.menu.mymenu.getParentToChildrenRelationName()

Last updated