A mixin for all number textboxes
See the dijit/form/NumberTextBox.Mixin reference documentation for more information.
Despite the name, this parameter specifies both constraints on the input (including minimum/maximum allowed values) as well as formatting options like places (the number of digits to display after the decimal point).
Properties to mix into constraints when the value is being edited. This is here because we edit the number in the format "12345", which is different than the display value (ex: "12,345")
The value of this NumberTextBox as a Javascript Number (i.e., not a String). If the displayed value is blank, the value is NaN, and if the user types in an gibberish value (like "hello world"), the value is undefined (i.e. get('value') returns undefined).
Symmetrically, set('value', NaN) will clear the displayed value, whereas set('value', undefined) will have no effect.
Format a Number as a String, using locale-specific settings
Create a string from a Number using a known localized pattern. Formatting patterns appropriate to the locale are chosen from the Common Locale Data Repository as well as the appropriate symbols and delimiters. If value is Infinity, -Infinity, or is not a valid JavaScript number, return null.
Parameter | Type | Description |
---|---|---|
value | Number | the number to be formatted |
options | Object |
Optional An object with the following properties:
|
Hook so get('value') works. Returns Number, NaN for '', or undefined for unparseable text
Convert a properly formatted string to a primitive Number, using locale-specific settings.
Create a Number from a string using a known localized pattern. Formatting patterns are chosen appropriate to the locale and follow the syntax described by unicode.org TR35 Note that literal characters in patterns are not supported.
Parameter | Type | Description |
---|---|---|
expression | String | A string representation of a Number |
options | Object |
Optional An object with the following properties:
|
Builds the regular needed to parse a number
Returns regular expression with positive and negative match, group and decimal separators
Parameter | Type | Description |
---|---|---|
options | Object |
Optional An object with the following properties:
|
Parameter | Type | Description |
---|---|---|
constraints | Object |
Hook so set('value', ...) works.
Parameter | Type | Description |
---|---|---|
value | Number | |
priorityChange | Boolean |
Optional
|
formattedValue | String |
Optional
|
This is called with both the display value (string), and the actual value (a number). When called with the actual value it does corrections so that '' etc. are represented as NaN. Otherwise it dispatches to the superclass's filter() method.
See dijit/form/TextBox.filter()
for more details.
Parameter | Type | Description |
---|---|---|
value | Number |
Formats the value as a Number, according to constraints.
Parameter | Type | Description |
---|---|---|
value | Number | |
constraints | Object | An object with the following properties:
|
Parameter | Type | Description |
---|---|---|
isFocused | Boolean |
Replaceable function to convert a formatted string to a number value
Parameter | Type | Description |
---|---|---|
value | String | |
constraints | Object | An object with the following properties:
|
Convert value (a Number) into a canonical string (ie, how the number literal is written in javascript/java/C/etc.)
Parameter | Type | Description |
---|---|---|
value | Number | |
options | Object |
Optional
|