CheckBox
<input id="repair_cover_glass_broken"
type="checkbox"
value="Cover glass broken"
data-win-control="HFWinJSCtrl.CheckBox"
data-win-options="{
label: 'Cover glass broken',
list: true,
defaultValue: true,
style: 'default | highlightChecked | toggleButton',
toggle: {
defaultClass: 'hf-radio-red',
checkedClass: 'highlight'
}
}">
FormControl Options
defaultValue
Set the defaultValue to "true" to display the CheckBox as checked by default. A custom code function can be used to set defaultValue.
defaultValue: true
boolean | function
function() => boolean
disabled
Set "true" whenever the checkbox should be disabled.
disabled: true
boolean
doNotCopy
Set "true" whenever the field should get deleted if form is copied.
doNotCopy: true
boolean
htmlLabel
Define a label that allows html tags inside the text set next to the checkbox. If a label and a htmlLabel is set, the htmlLabel overwrites the label.
htmlLabel: 'Cover glass broken'
string
label
Define a label set next to the checkbox (optional)
label: 'Cover glass broken'
string
list
Set this property to "true" if data connected with this control should be a sorting/filtering/grouping option on the listpage, is used in template objects (eg. the listTemplate) or it should show up in admin ui listings.
list: true
boolean
listOptions
Set additional options for controls with list equals true. E.g. set custom label for filter/sort/group dialogs or hide them complettely.
listOptions: {...}
{ dialogText: string, dialogHide: boolean }
onChanged
Call a pre-defined JS-method to do something when the status of the control changes
onChanged: HFFormdefinition.Namespace.Method
function
function(data: { value: boolean, hfValue: string }) => void
persistent
The value "user" sets the initial value of the checkbox to the value of the previous form item of the current user and overwrites any defaultValue.
persistent: 'user'
'user'
style
Define the display behaviour of the radiobox and its label depending on its status (checked/unchecked). Default is the previously familiar behavior, highlightChecked softens the unchecked input ctrl and its label and emphasizes the checked control by bold font and dark font color.
style: 'default'
'default' | 'highlightChecked' | 'toggleButton' | 'backgroundHighlight'
toggle
Define up to two CSS classes applied to the container-div of the checkbox to emphasize the toggle-effect of the form control. At least the "defaultClass" has to be defined. Note: Use in case of style: 'toggleButton' to assign the background color, this option is ignored in case of the other two possibilities.
toggle: {defaultClass: 'hf-radio-orange', checkedClass: 'highlight'}
string
visiting
Set "true" whenever the form element should be marked as "visited" when the user has clicked or tapped at the form field.
visiting: true
boolean
listOptions Object
dialogText
Set custom label for filter/sort/group dialogs.
dialogText: 'Display Text'
string
Stored data
<input id="repair_cover_glass_broken"
type="checkbox"
data-win-control="HFWinJSCtrl.CheckBox"
value="Cover glass broken"
data-win-options="{
label: 'Cover glass broken',
list: true,
defaultValue: true
}"
>
For each checked CheckBox inside your forms there are two value pairs of stored data:
First the information if the Checkbox is checked
{
"id": "repair_cover_glass_broken",
"value": true
}
and for the defined value:
{
"id": "repair_cover_glass_broken_HFValue",
"value": "Cover glass broken"
}