Class: Model

ko/ui/menu~ Model


Model()

The model for the menu UI element, this is what model:ko/ui/menu.create returns

Properties:
Name Type Description
name string

The node name of the element

element Element

A XUL menu, see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/menu

menupopup model:ko/ui/menupopup~Model

A XUL menu, see model:ko/ui/menupopup~Model

Extends

Methods


<static> addMenuItem(item)

Add an item to the container

Parameters:
Name Type Description
item mixed

item to be added to the container. Can be String (label), ko/ui/, ko/dom element, DOM element, option object. option object refers to an Options object used throughout this SDK. The options should contain an attributes property to assign a label at the very least: { label: "itemLabel" }

Returns:
Type
Element

<static> addMenuItems(items)

Add items to the menu

Parameters:
Name Type Description
items array

Array of items to add, this calls addMenuItem() for each item