Parsing Values

After editing cells in the grid you have the opportunity to parse the value before inserting it into your data. This is
done using Value Parsers.

Value Parser

For example suppose you are editing a number using a text editor. The result will be a string, however you will
probably want to store the result as a number. Use a Value Parser to convert the string to a number.

columnDefs = [
    {
        # name is a string, so don't need to convert
        'field': 'name',
        'editable': True,
    },
    {
        # age is a number, so want to convert from string to number
        'field': 'age',
        'editable': True,
        'valueParser': {'function': 'Number(params.newValue)'}
    }
]

If using Cell Data Types, Value Parsers are set by default
to handle the conversion of each of the different data types.

The return value of a value parser should be the result of the parse, for example, return the value you want stored in
the data.

Below shows an example using value parsers. The following can be noted: