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.
culture: 'de-CH'
string
defaultValue
Set a numeric default value. A custom code function can be used to set defaultValue.
defaultValue: 123
number | function
function() => number
disabled
Set "true" whenever the NumericField should be disabled.
disabled: true
boolean
disableOpenDialog
Set "true" whenever the NumericField should be prevented opening in a dialog and hide spinner buttons on mobile devices.
disableOpenDialog: true
boolean
doNotCopy
Set "true" whenever the field should get deleted if form is copied.
doNotCopy: true
boolean
format
Define the format of the value shown in the final form. https://docs.telerik.com/kendo-ui/globalization/intl/numberformatting
format: '0.0°'
string
inputMode
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
inputMode: 'numeric'
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(value: number) => void
persistent
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.
persistent: 'user'
'user'
placeholder
Define a placeholder text for the NumericField.
placeholder: '°C'
string
step
Define the value of increase / decrease step when using the up and down arrows.
step: 0.1
number
tooltip
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.
tooltip: 'Please indicate at least one cause of damage.'
string
tooltipTemplate
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.
tooltipTemplate: 'example_control_tooltip'
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
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.
dialogText: 'Display Text'
string
copyValueTo
Define FormControls in which the entered value should be copied.
<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>
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.
callback: HFFormDefinition.Namespace.processValue
function
function(value: string) => string
mode
Specify if target field gets overwritten. Default behviour is to only copy to empty fields.
mode: 'overwrite'
string
shadowPostfix
Specify which shadow field is copied.
shadowPostfix: '_HFNumericField'
string
Stored 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"
}