Interface NumberFieldTemplate

A template that declares a number field control in a DialogTemplate.

Hierarchy

Index

Properties

Optional beforeRemove

beforeRemove: function

If defined, this function will be called just before elements that represent the control have been added to the document tree.

Type declaration

Optional chain

chain: boolean

If true, this control will not appear on its own line but will instead be appended to the previously declared control. Multiple controls can be chained in sequence to combine them into one long row. When true, the control's label property has no effect.

Optional cols

cols: number

This is a hint as to how wide the field should be, in columns.

Optional disabled

disabled: boolean

If true, the control will be disabled and the user will not be able to interact with it or change its value.

Optional element

element: HTMLInputElement

This will point to the DOM element that best represents the control. This property is set by the interface framework and should be considered read only except for CustomWidgetTemplates.

Optional id

id: string

If defined, this control can be looked up from the template's controls array using this value. It must conform to the regular expression /^[A-Za-z][\w\-\:\.]*$/.

Optional initialFocus

initialFocus: boolean

If true, this control will be given focus when the dialog is shown. Default is false.

Optional label

label: string

If defined, this text will be used as a label for the control.

Optional Readonly labelElement

labelElement: HTMLLabelElement

If the control has a label that appears in the dialog, this will point to the DOM element responsible for the label. This property is set by the interface framework and should be considered read only.

Optional max

max: number

Sets the maximum value of the field. Default is 100.

Optional min

min: number

Sets the minimum value of the field. Default is 0.

Optional onAdd

onAdd: function

If defined, this function will be called once elements that represent the control have been added to the document tree.

Type declaration

Optional onUse

onUse: function

If defined, this function will be called whenever the user changes the control's value. If the function makes changes to the template state (changing label text, disabled state, and so on), those changes will be propagated to the actual dialog. If changes are made to the structure of the dialog (such as adding or removing a control), the function must indicate this by returning true. This will cause the dialog content to be rebuilt.

Type declaration

Optional placeholder

placeholder: string

If defined, the text field might display this text when the field is empty, as a hint to the user.

Optional Readonly rootElement

rootElement: HTMLElement

If a tree of DOM nodes is required to represent this control, this will point to the root element of that tree. This property is set by the interface framework and should be considered read only.

Optional spokenLabel

spokenLabel: string

If defined, screen readers will use this as the label for the control.

Optional step

step: number

Sets the step size. On supported platforms (typically desktop/notebook class devices), the number field will include arrow buttons to step through possible values. The step size sets the increment and decrement that the arrow buttons apply to the current value. Default is 1.

Optional text

text: string

This property will reflect the current text of the text field.

type

type: "number"

The type property must be set to "number".

Optional value

value: number

This property will reflect the current value of the field. Default is the minimum value.

This API is still under development and is subject to change. Copyright © Math I Can Do Solutions Incorporated and/or its licensors.