Numeric Cell Editor
Summary
- Numeric Cell Editor is provided by AdapTable whenever a numeric cell is edited
- It is also used when filtering a numeric column
The Numeric Cell Editor is used, by default in AdapTable, when editing all numeric Columns.
A numeric column is one where the Cell Data Type is set to number.
Note
It is also used when a FreeText Column is defined as numeric
It displays an editor with arrows at the end to move up and down and only accepts numbers (with fractions).
Hint
The Numeric Cell Editor will take into account any Shortcuts that have been created
Cell Editor Params
The Numeric Cell Editor can be configured by specifying cellEditorParams in the AG Grid Column Definition.
This maps to the AdaptableNumberCellEditorParams object and contains 2 main properties:
-
showClearButton- specifies whether to show the Clear button in the EditorNote
If set to
true(the default value), it works together withemptyValue -
emptyValue- value to set in a cell when the Clear button is pressed (defaults to an empty string)
Caution
- Some AG Grid Column Definitions have a
valueParserwhich is provided as a function - In that use case, the function will be invoked before setting the value for the cell
- This demo illustrates how to use the Numeric Cell Editor. For the
GitHub Starscolumn, we provide 2 Cell Editor Params:showClearButtonis set to true so we see a Clear Button (that is the default behaviour anyway)emptyValuehas been set to 1000 (instead of default of 0)
- Clear a cell in the Numeric Editor in the
Github StarsColumn and note how the edit value changes to 1000