Module

RMP_CheckBox


new RMP_CheckBox(conf)

This constructor allows you to create a checkbox widget that can be inserted dynamically in your web interface.

Parameters:
Name Type Description
conf Object JSON structure which contains the configuration of the checkbox
Example
var switchConf = {
     id: 'id_check',
     label: 'Checker',
     variables: [{ id: 'variable', name: 'check', value: 'yes' }],
     valueoff: 'no',
     valueon: 'yes'
 };
 var check = new RMP_CheckBox(switchConf);
 id_of_a_widget.insertAbove(check);

Methods

# inner getType() → {string}

Returns the type of the widget (RMP_CheckBox).
string

# inner isChecked() → {boolean}

Returns true if the box is checked, otherwise false.
boolean

# inner setChecked(checked)

Checks the box if called with true, and unchecks the box if called with false.
Parameters:
Name Type Description
checked boolean true: check, false: uncheck