NumericField
NumericFields restrict the input value to numbers in the case of a simple input field or you refine it by further properties to offer a kind of slider.
<div id="temperatur"
data-win-control="HFWinJSCtrl.NumericField"
data-win-options="{
step: 0.1,
min: 20,
max: 45,
placeholder: '°C',
decimals: 1,
format: '0.0°',
startValue: 36
}"></div>
FormControl Options​
Options of the kendo component are also available. read more
culture​
Set the number format according to the lingual characteristics.
How to use:
culture: 'de-CH'Type:
stringdefaultValue​
Set a numeric default value. A custom code function can be used to set defaultValue.
How to use:
defaultValue: 123Type:
number | functionSignature:
function() => numberdisabled​
Set "true" whenever the NumericField should be disabled.
How to use:
disabled: trueType:
booleandisableOpenDialog​
Set "true" whenever the NumericField should be prevented opening in a dialog and hide spinner buttons on mobile devices.
How to use:
disableOpenDialog: trueType:
booleandoNotCopy​
Set "true" whenever the field should get deleted if form is copied.
How to use:
doNotCopy: trueType:
booleanformat​
Define the format of the value shown in the final form. https://docs.telerik.com/kendo-ui/globalization/intl/numberformatting
How to use:
format: '0.0°'Type:
stringinputMode​
Set the virtual keyboard on a mobile device to a certain type of data. But be careful with this setting. If region settings on the phone differs to culture settings in the form, this could lead to unwanted behaviour. For all available options see this here
How to use:
inputMode: 'numeric'Type:
stringlist​
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.
How to use:
list: trueType:
booleanlistOptions​
Set additional options for controls with list equals true. E.g. set custom label for filter/sort/group dialogs or hide them complettely.
How to use:
Type:
{ dialogText: string, dialogHide: boolean }onChanged​
Call a pre-defined JS-method to do something when the status of the control changes
How to use:
onChanged: HFFormdefinition.Namespace.MethodType:
functionSignature:
function(value: number) => voidpersistent​
The value "user" sets the initial value of the NumericField to the value of the previous form item of the current user and overwrites any defaultValue.
How to use:
persistent: 'user'Type:
'user'placeholder​
Define a placeholder text for the NumericField.
How to use:
placeholder: '°C'Type:
stringstep​
Define the value of increase / decrease step when using the up and down arrows.
How to use:
step: 0.1Type:
numbertooltip​
Write a comment to provide further information about the field. A question mark will then be shown within the label and with a click/tap on it, the information will occur.
How to use:
tooltip: 'Please indicate at least one cause of damage.'Type:
stringtooltipTemplate​
Write an id of a html container to provide further information about the field. A question mark will then be shown within the label and with a click/tap on it, the content of the container will occur.
How to use:
tooltipTemplate: 'example_control_tooltip'Type:
stringvisiting​
Set "true" whenever the form element should be marked as "visited" when the user has clicked or tapped at the form field.
How to use:
visiting: trueType:
booleanNote
For defining the format to be displayed as percentage value you have to escape the special character by using the number sign and two back slashes (i.e. format: '# \%').
listOptions Object​
dialogText​
Set custom label for filter/sort/group dialogs.
How to use:
dialogText: 'Display Text'Type:
stringcopyValueTo​
Define FormControls in which the entered value should be copied.
Example
<div id="numeric_field_copy_source"
data-win-control="HFWinJSCtrl.NumericField"
data-win-options="{
label: 'NumericField: source',
spinners: false,
disableOpenDialog: true,
format: '# kWp',
copyValueTo: ['numeric_field_copy_target_1', {
targetId: 'numeric_field_copy_target_2',
shadowPostfix: '_HFNumericField',
mode: 'overwrite'
}]
}"></div>
Option interface
interface ICopyValueToObject {
targetId: string;
mode: 'overwrite' | null;
shadowPostfix: string;
callback: (value: string) => string;
}
type CopyValueToType = string | ICopyValueToObject | Array<string | ICopyValueToObject>;
callback​
Specify a function to process value before copy.
How to use:
callback: HFFormDefinition.Namespace.processValueType:
functionSignature:
function(value: string) => stringmode​
Specify if target field gets overwritten. Default behaviour is to only copy to empty fields.
How to use:
mode: 'overwrite'Type:
stringshadowPostfix​
Specify which shadow field is copied.
How to use:
shadowPostfix: '_HFNumericField'Type:
stringStored data​
<div id="temperatur" data-win-control="HFWinJSCtrl.NumericField" data-win-options="{
step: 0.1,
min: 20,
max: 45,
placeholder: '°C',
decimals: 1,
format: '0.0°',
startValue: 36 }" >
</div>
For each NumericField inside your forms there are two value pairs of stored data:
{
"id": "temperatur",
"value": 36.2
}
{
"id": "temperatur_HFNumericField",
"value": "36°C"
}