Class: Model

ko/ui/menupopup~ Model


Model()

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

Properties:
Name Type Description
name string

The node name of the element

element Element

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

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:

Returns the inserted element, may be a ko/ui/element, ko/dom element or DOM element

Type
Element

<static> addMenuItems(item)

Add items to the menupopup

Parameters:
Name Type Description
item array

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


<static> addSeparator( [attr])

Parameters:
Name Type Argument Description
attr object <optional>

Attributes


<static> hide()

Hide/close the menupopup


<static> open()

Open the menupopup


<static> removeItem(item)

Removes the given menuitem

Parameters:
Name Type Description
item mixed

menuitem to be removed to the container, see addMenuItem() for type info