NumberColumn
A column for showing/editing numbers.
Default editor is a NumberField.
new Grid({
appendTo : document.body,
columns : [
{ type: 'number', min: 0, max : 100, field: 'score' }
]
});
Provide a NumberFormat config as format to be able to show currency. For example:
new Grid({
appendTo : document.body,
columns : [
{
type : 'number',
format : {
style : 'currency',
currency : 'USD'
}
}
]
});
Useful configs
| Config | Description |
|---|---|
| format | Number format string or config object |
| min | Minimum allowed value |
| max | Maximum allowed value |
| step | Spin step amount |
See also
- CurrencyColumn - Column for currency values
- PercentColumn - Column with progress bar
- NumberFormat - Number formatting options
- NumberField - Default editor widget
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Large step size, defaults to 10 *
step. Applied when pressing SHIFT and stepping either by click or when using the Up/Down keys.Has a corresponding runtime largeStep property.
-
The maximum value for the field used during editing.
Has a corresponding runtime max property.
-
The minimum value for the field used during editing.
Has a corresponding runtime min property.
-
Step size for the field used during editing. Also used when pressing up/down keys in the field.
Has a corresponding runtime step property.
-
Unit to append to displayed value.
Has a corresponding runtime unit property.
-
Text align. Accepts
'left'/'center'/'right'or direction neutral'start'/'end'Has a corresponding runtime align property.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of NumberColumn class, or subclass thereof.
-
Large step size, defaults to 10 *
step. Applied when pressing SHIFT and stepping either by click or when using the Up/Down keys.Has a corresponding largeStep config.
-
The maximum value for the field used during editing.
Has a corresponding max config.
-
The minimum value for the field used during editing.
Has a corresponding min config.
-
Step size for the field used during editing. Also used when pressing up/down keys in the field.
Has a corresponding step config.
-
Unit to append to displayed value.
Has a corresponding unit config.
-
Identifies an object as an instance of NumberColumn class, or subclass thereof.
-
Text align. Accepts
'left'/'center'/'right'or direction neutral'start'/'end'Has a corresponding align config.