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 Editor

    Note

    If set to true (the default value), it works together with emptyValue

  • 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 valueParser which is provided as a function
  • In that use case, the function will be invoked before setting the value for the cell
Numeric Cell Editor Params
Fork
  • This demo illustrates how to use the Numeric Cell Editor. For the GitHub Stars column, we provide 2 Cell Editor Params:
    • showClearButton is set to true so we see a Clear Button (that is the default behaviour anyway)
    • emptyValue has been set to 1000 (instead of default of 0)
Try It Out
  • Clear a cell in the Numeric Editor in the Github Stars Column and note how the edit value changes to 1000