Class: CheckboxControl

hcje/domTools.CheckboxControl(config, onChange)

Checkbox control. Simple implementation of a checkbox.

Constructor

new CheckboxControl(config, onChange)

Construct the checkbox

Parameters:
Name Type Description
config Object
Properties
Name Type Description
label string

Checkbox label

initialValue boolean

True if initial state is checked

tick boolean

True if a tick should be used in place of the default cross.

onChange module:hcje/domTools.CheckboxControl~onChangeCallback

Function called if state changes.

Source:

Extends

  • module:hcje/domTools.BaseControl

Methods

getValue() → {boolean}

Get checked state.

Source:
Returns:

True if currently checked.

Type
boolean

Type Definitions

onChangeCallback(checked)

Callback function for a checkbox.

Parameters:
Name Type Description
checked boolean

True if the current state is checked.

Source: