To echo the answer by @Steve-Mcl - the below should cater for it.
The definition and necessary callbacks.
RED.nodes.registerType('my-module', {
defaults: {
bits: {
value: []
}
},
oneditsave: Save,
oneditprepare: Restore
});
function Save() {
const NumCheckBoxes = 3;
this.bits = [];
for (let i = 0; i < NumCheckBoxes; i++) {
this.bits.push($(`#CheckBoxIndex_${i}`).is(":checked"));
}
}
function Restore() {
for (let i = 0; i < this.bits.length; i++) {
$(`#CheckBoxIndex_${i}`).prop('checked', this.bits[i]);
}
}
And the HTML. No need for the node-input-
ID prefix, as they are not directly associated with a config definition.
<div class="form-row">
<label for="CheckBoxIndex_0" style="width:130px"><i class="fa fa-pencil"></i> CheckBox 1</label>
<input type="checkbox" id="CheckBoxIndex_0">
</div>
<div class="form-row">
<label for="CheckBoxIndex_1" style="width:130px"><i class="fa fa-pencil"></i> CheckBox 2</label>
<input type="checkbox" id="CheckBoxIndex_1">
</div>
<div class="form-row">
<label for="CheckBoxIndex_2" style="width:130px"><i class="fa fa-pencil"></i> CheckBox 3</label>
<input type="checkbox" id="CheckBoxIndex_2">
</div>
Then, in your module
config.bits[0]
will yield true
| false
for checkbox 1