Class: Menu

Menu(uid, url, parameterName)

Menu is the data for html anchors of data-type menu. This is organized as at tree. A menu has an uniq id, an url and a optional parameter name. When the parameter name is 'uid' the value of the uid is appended to the url path. Otherwise it is appended as parameter to the url. The menu maintains it state whether it is visible or not and selected or not.

Constructor

Parameters:
Name Type Description
uid int

A uniq id

url string

A url for this menu

parameterName string

The name of parameter.

Source:

Members

selected

Tells whether this menu is selected or not.

Source:

url

Gets the calculated url for this menu.

Source:

visible

Tells whether this menu is visible or not.

Source:

Methods

ensureVisible()

Ensure that the menu and it's intermediate children are visible.

Source:

getByUid(uid) → {Menu|null}

Find a menu with by uid

Parameters:
Name Type Description
uid int

The search uid

Source:
Returns:

If found it returns the menu otherwise null

Type
Menu | null

hasMatch(url) → {boolean}

Find a menu in this menu or its children which matches a given url

Parameters:
Name Type Description
url string
Source:
Returns:

True when found otherwise false

Type
boolean

push(data) → {Menu}

Add a child menu to this menu

Parameters:
Name Type Description
data Menu

The child menu to be added

Source:
Returns:

The given child menu

Type
Menu

reset()

Resets this menu and all it's to a known state which not visible and not selected

Source:

select(url)

Find a menu in this menu or its children which matches a given url

Parameters:
Name Type Description
url string

The given url

Source:

setParameter(args)

Set the value of the parameter name for this menu and its children.

Parameters:
Name Type Description
args collect

A set of parameter values.

Source: