new Choice(options)
Class for creating checkbox and radio input widgets
Parameters:
Name | Type | Description |
---|---|---|
options |
module:nyc/Choice~Choice.Options |
Fires:
Extends
Methods
-
append(elements)
-
A method to append elements to the container
Parameters:
Name Type Description elements
jQuery | Element | Array.<Element> | string The element to append
- Inherited From:
- Source:
Returns:
The container
- Type
- jQuery
-
find(selector)
-
A method to return elements in the container
Parameters:
Name Type Description selector
string jQuery selector
- Inherited From:
- Source:
Returns:
The element
- Type
- jQuery
-
getContainer()
-
A method to return a control container HTML element wrapped in a JQuery
- Inherited From:
- Source:
Returns:
The the control container HTML element wrapped in a JQuery
- Type
- jQuery
-
prepend(elements)
-
A method to prepend elements to the container
Parameters:
Name Type Description elements
jQuery | Element | Array.<Element> | string The element to append
- Inherited From:
- Source:
Returns:
The container
- Type
- jQuery
-
setChoices(choices)
-
Set the available choices
Parameters:
Name Type Description choices
Array.<module:nyc/Choice~Choice.Choice> The choices
-
val(choices)
-
Get or set the seleced choices
Parameters:
Name Type Description choices
Array.<module:nyc/Choice~Choice.Choice> The choices
Type Definitions
-
Choice
-
A choice for module:nyc/Choice~Choice
Type:
- Object
-
Options
-
Constructor options for module:nyc/Choice~Choice
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description target
jQuery | Element | string The target DOM node for creating the choice control
choices
Array.<module:nyc/Choice~Choice.Choice> The choices
radio
boolean <optional>
false Checkbox or radio button
Events
-
change
-
The change event
Type: module:nyc/Choice~Choice