Class: Model

ko/ui/listbox~ Model


Model()

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

Properties:
Name Type Description
name string

The node name of the element

element Element

A XUL listbox

listhead Element

module:ko/ui/listhead~Model

listcols Element

module:ko/ui/listcols~Model

Extends

Methods


<static> addListCol(item)

Add list column

Parameters:
Name Type Description
item mixed

Calls @module:ko/ui/listcols~Model.addListCol


<static> addListCols(items)

Add list columns to the listbox

Parameters:
Name Type Description
items array

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


<static> addListHeader(item)

Add list header

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" }


<static> addListHeaders(items)

Add list headers to the listbox

Parameters:
Name Type Description
items array

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


<static> addListItem(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" }

Object refers to an Options object used through this SDK. The options should contain an attributes property to assign a label at the very least:

{ attributes: { label:"itemLable" } }


<static> addListItems(items)

Add items to the listbox

Parameters:
Name Type Description
items array

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


<static> getSelectedItem()

Get the selected item index in the lists

Returns:

the selected item

Type
element

<static> getSelectedItems()

Get list of selected items

Returns:

an array of selected items

Type
array

<static> removeAllItems()

Remove all items from the list


<static> setSelectedIndex(index)

Set the selected item index in the lists

Parameters:
Name Type Description
index integer

The index of the item to be selected


<static> value()

Get the value/label of the selected item

Returns:

the value or label of the selected item

Type
String