Editing Technical Reference

Summary

  • Edit Options contains a number of useful editing-related options
  • Cell Changed Event published by AdapTable whenever the contents of the Cell Changes
    • Can be the result of a User edit in AG Grid or Ticking data updates
    • The event provides full details of the change and where in AG Grid it happened

Edit Options

The Edit Options section of Adaptable Options contains these properties:

PropertyTypeDescriptionDefault
customEditColumnValues(context:CustomEditColumnValuesContext<TData>) =>CustomEditColumnValueInfo[] | Promise<CustomEditColumnValueInfo[]>List of Column values to display when Editing (i.e. in Edit Lookups, Bulk Update)
displayServerValidationMessagesbooleanWhether to display message after Server Validation runstrue
isCellEditable(cellEditableContext:CellEditableContext<TData>) => booleanFunction which checks if a given Grid Cell is editable
plusMinusOptionsPlusMinusOptionsOptions for Plus Minus module (keyboard increment / decrement)
showSelectCellEditor(currentColumContext:AdaptableColumnContext<TData>) => booleanColumns that will display a Select dropdown when editing
smartEditOptionsSmartEditOptions<TData>Options for Smart Edit module
validateOnServer(serverValidationContext:ServerValidationContext<TData>) => Promise<ServerValidationResult>Function to validate AdapTable data edits remotely

Smart Edit Options

The Smart Edit Options section contains these properties:

PropertyTypeDescription
customOperationsSmartEditCustomOperation<TData>[]Custom Operations to use in Smart Edit

Plus Minus Options

The Plus Minus Options section contains these properties:

PropertyTypeDescriptionDefault
decrementKeystringKey to decrease cell value for nudges (if not overriden in Plus Minus Rule)'-'
incrementKeystringKey to increase cell value for nudges (if not overriden in Plus Minus Rule)'+'

Cell Changed Event

The Cell Changed Event fires whenever the contents of any cell changes in AG Grid.

This can be the result of a user cell edit or of ticking data.

CellChangedInfo

The event comprises the CellChangedInfo object:

PropertyTypeDescription
cellDataChangeCellDataChangedInfoObject providing full information of the cell (and column and row) that changed
adaptableContextanyCustom application Context provided in AdaptableOptions.adaptableContext

This provides a single cellChange property of type CellDataChangedInfo defined as follows:

PropertyTypeDescription
changedAtnumberTimestamp of change occurrence (in milliseconds)
columnAdaptableColumn<TData>Column in which cell is situated
newValueanyNew value for the cell
oldValueanyValue in the Cell before the edit
preventEditbooleanWhether the change was prevented by a validation rule
primaryKeyValueanyPrimary Key Column's value for the row where edited cell is situated
rowDataTDataData in the Row
rowNodeIRowNode<TData>AG Grid RowNode that contains the cell
trigger'edit' | 'tick' | 'undo' | 'aggChange' | 'calculatedColumnChange'What triggered the change - user, background change, a reverted change, or a derived update on a Calculated Column whose source value changed?

Event Subscription

Subscribing to the Event is done the same way as with all Adaptable Events:

api.eventApi.on('CellChanged', (eventInfo: CellChangedInfo) => {
    // do something with the info
});