Class: Model

ko/ui/radiogroup~ 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 hbox, see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/hbox

formElement Element

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

$formElement Element

A @module:ko/dom~QueryObject

Extends

Methods


<static> addRadioItem(item)

Add an item to the container

Example
`opts` refers to an Options object used throughout this SDK. The options
should contain an attributes property to assign a label at the very
least:
 {
     attributes:
     {
         label:"itemLable",
         value:"itemValue // if not supplied, `label` is used as `value`
     }
 }
Parameters:
Name Type Description
item string | object | array | 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:

DOM element Object

Type
Element

<static> addRadioItems(item)

Add multiple item to the container

Parameters:
Name Type Description
item Array

item to be added to the container. Array of items to add, this calls addRadioItem() for each item


<static> onChange(callback)

Add onChange even handler

Parameters:
Name Type Description
callback function

eventhandler callback

Deprecated:
  • use `.on("command", callback)` instead

<static> value( [value])

Return or set the current value of the element.

Parameters:
Name Type Argument Description
value String <optional>

value to be set

Returns:

the value of the element

Type
String