Editing Technical Reference
Adaptable Options
Edit Options
EditOptions
Options related to Editing in AdapTable - includes Server Validation, Smart Edit Operations and Cell Editabiility
(context:CustomEditColumnValuesContext<TData>) =>CustomEditColumnValueInfo[] | Promise<CustomEditColumnValueInfo[]>
List of Column values to display when Editing (i.e. in Edit Lookups, Bulk Update)
boolean
Whether to display message after Server Validation runs
true
(cellEditableContext:CellEditableContext<TData>) => boolean
Function which checks if a given Grid Cell is editable
Keys that nudge a numeric cell up or down.
A Plus Minus rule can set its own key. These are the keys used when it does not.
(currentColumContext:AdaptableColumnContext<TData>) => boolean
Columns that will display a Select dropdown when editing
SmartEditOptions<TData>
Extra Smart Edit operations, beyond the ones AdapTable ships.
A Smart Edit applies one operation to every selected cell.
(serverValidationContext:ServerValidationContext<TData>) => Promise<ServerValidationResult>
Function to validate AdapTable data edits remotely
isCellEditable receives a CellEditableContext:
CellEditableContext
Context used when checking Cell editability
boolean
Default editability according to the AG Grid Column Definition (ColDef.editable)
Custom application Context provided in AdaptableOptions.adaptableContext
customEditColumnValues receives a CustomEditColumnValuesContext and returns CustomEditColumnValueInfo objects:
CustomEditColumnValuesContext
Context used when getting Distinct Column Values for Editing
AdaptableColumnContext<TData>
string
Search text in Edit - used when fetching values from server
Required<CustomEditColumnValueInfo>[]
Current distinct values in Column
Custom application Context provided in AdaptableOptions.adaptableContext
CustomEditColumnValueInfo
Information about items in the custom Edit Controls
validateOnServer receives a ServerValidationContext and returns a ServerValidationResult:
ServerValidationContext
Context used when validating data edits on Server
Details of Cell Edit
Custom application Context provided in AdaptableOptions.adaptableContext
ServerValidationResult
Used for Server Validation ie. after an edit in AG Grid which must be checked on Server
any
Cell Value to use for after Server Validation
string
Message to diplay with validation
Smart Edit Options
SmartEditOptions
Options for editing-based Smart Edit Module
SmartEditCustomOperation<TData>[]
Custom Operations to use in Smart Edit
A custom operation is { name: string; operation: (context) => number }. The operation receives a SmartEditOperationContext:
SmartEditOperationContext
Context used in Custom Smart Edit Operations
GridCell<TData>
Current selected grid cell - contains column, row and cell value information
number
Smart Edit value
Custom application Context provided in AdaptableOptions.adaptableContext
Plus Minus Options
PlusMinusOptions
Options for editing-based Plus Minus Module
string
Key to decrease cell value for nudges (if not overriden in Plus Minus Rule/Nudge).
Can be a single key (e.g. '-') or a keyboard shortcut combination that uses+ as the glue between parts (e.g. 'shift+Backspace', 'ctrl+ArrowDown').
Supported modifiers are ctrl, cmd, alt and shift.
'-'
string
Key to increase cell value for nudges (if not overriden in Plus Minus Rule/Nudge).
Can be a single key (e.g. '+') or a keyboard shortcut combination that uses+ as the glue between parts (e.g. 'shift+Enter', 'ctrl+ArrowUp').
Supported modifiers are ctrl, cmd, alt and shift.
'+'
Adaptable State
Plus Minus State
PlusMinusState
Plus Minus section of Adaptable State, including Initial State.
Each nudge adds or subtracts NudgeValue from numeric cells in Scope. The increment key adds NudgeValue; the decrement key subtracts it. A nudge's own keys override plusMinusOptions, which override the default + and - keys.
Nudges to apply. Each one names numeric columns, the amount, and optional keys.
Plus Minus
PlusMinusNudge
Adds or subtracts a fixed amount from numeric cells.
Scope is numeric columns only. The increment key sets the cell to its current value plus NudgeValue; the decrement key subtracts NudgeValue. Omit Rule to apply the nudge on every row in scope. Suspend with IsSuspended.
string
Optional keyboard key that decreases cell values for this nudge only (overrides the
global decrementKey in plusMinusOptions).
Can be a single key (e.g. '-') or a keyboard shortcut combination that uses + as the glue
between parts (e.g. 'shift+Backspace', 'ctrl+ArrowDown'). Supported modifiers are ctrl,cmd, alt and shift.
string
Optional keyboard key that increases cell values for this nudge only (overrides the
global incrementKey in plusMinusOptions).
Can be a single key (e.g. '+') or a keyboard shortcut combination that uses + as the glue
between parts (e.g. 'shift+Enter', 'ctrl+ArrowUp'). Supported modifiers are ctrl, cmd,alt and shift.
string
Name of the Plus Minus Nudge rule
number
Amount added by the increment key and subtracted by the decrement key.
string
(Optional) AdapTableQL boolean expression, evaluated per row, to determine whether to apply the Nudge
Numeric columns where the nudge is applied
boolean
Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
boolean
Suspends (i.e. turns off) an Adaptable Object
Scope
ColumnScope
Which columns an object applies to. Set exactly one shape.
true
Matches every column. All must be true.
('text' | 'number' | 'boolean' | 'date' | 'textArray' | 'numberArray')[]
Data types to match, for example ['number'] or ['text', 'textArray']. Object, tuple and unknown columns are not scope data types. Name those columns with ColumnIds.
string[]
Column ids to match. These are AG Grid colId values.
string[]
AG Grid column type names, the strings set on colDef.type.
Shortcut State
ShortcutState
Shortcut section of Adaptable State, including Initial State.
Each shortcut updates a numeric cell while its editor is open and ShortcutKey is pressed. The cell value is the first operand and ShortcutValue is the second. ShortcutOperation is 'Add', 'Subtract', 'Multiply' or 'Divide'. The first shortcut whose key and scope match is used. A ShortcutValue of 0 is ignored.
Shortcut Object
Shortcut
A key that updates a numeric cell with an arithmetic operation.
Scope is numeric columns only. Pressing ShortcutKey sets the cell to cellValue combined with ShortcutValue by ShortcutOperation. Suspend with IsSuspended.
string
Name of the Shortcut
Numeric Columns where Shortcut is applied
string
Key which triggers the Shortcut when pressed
'Add' | 'Subtract' | 'Multiply' | 'Divide'
The Operation: 'Add', 'Subtract', 'Multiply', 'Divide'
number
Value acting as 2nd operand for ShortcutOperation (1st operand is the cell value)
boolean
Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
boolean
Suspends (i.e. turns off) an Adaptable Object
Scope
Scope is a Column Scope object but limited to numeric columns:
ColumnScope
Which columns an object applies to. Set exactly one shape.
true
Matches every column. All must be true.
('text' | 'number' | 'boolean' | 'date' | 'textArray' | 'numberArray')[]
Data types to match, for example ['number'] or ['text', 'textArray']. Object, tuple and unknown columns are not scope data types. Name those columns with ColumnIds.
string[]
Column ids to match. These are AG Grid colId values.
string[]
AG Grid column type names, the strings set on colDef.type.
Adaptable API
Smart Edit API
SmartEditApi
Smart Edit: one change applied to every selected cell.
Retrieves an Smart Edit Custom Operations (provided in Edit Options)
Gets current Smart Edit Operation
number
Returns current Smart Edit Value
void
Opens Settings Panel with Smart Edit section selected and visible
Sets current Smart Edit Operation to a Custom Operation
void
Sets (shipped) Smart Edit Operation: 'Add','Subtract','Multiply','Divide'
void
Sets Smart Edit Value
Bulk Update API
BulkUpdateApi
Provides run-time access to the Bulk Update Module
string
The value Bulk Update will write into the selected cells.
void
Opens Bulk Update Settings Panel
Plus Minus API
PlusMinusApi
Plus Minus nudges that change a numeric cell by a configured amount.
Adds new Plus Minus Rule to State
void
Applies a Plus Minus to given cells
void
Deletes a plus minus rule
Replaces Plus Minus Rule in State with given one
Retrieves all active (not-suspended) Plus Minus Rules in Adaptable State with those with expressions first
Retrieves all Plus Minus Rules in Adaptable State with those with expressions first
Retrieves all suspended Plus Minus Rules in Adaptable State with those with expressions first
Retrieves Plus Minus Rule by the technical ID (from PlusMinusState)
PlusMinusNudge | undefined
Retrieves a Plus Minus Nudge by its Name
Retrieves Plus Minus section from Adaptable State (nudge rules only).
Keyboard triggers are optional on each ; unset fields fall back toAdaptableOptions.plusMinusOptions, then + / -.
void
Opens Settings Panel with Plus Minus section selected and visible
Applies a Plus Minus Rule to given cells
Suspends Plus Minus Rule
Activates a suspended Plus Minus Rule
Shortcut API
ShortcutApi
Keyboard shortcuts that change a cell value.
Adds new Shortcut to the state
void
Deletes Shortcut from the state
Edits Shortcut in state
Shortcut[]
Gets all active (not-suspended) Shortcuts in Adaptable State
Retrieves Shortcut by Id
Shortcut | undefined
Retrieves a Shortcut by its Name
Shortcut[]
Gets all Shortcuts in Adaptable State
Retrieves Shortcut section from Adaptable State
Shortcut[]
Gets all suspended Shortcuts in Adaptable State
void
Opens Settings Panel with Shortcut section selected and visible
void
Suspends all Shortcuts
Suspends Shortcut definition
void
Activates all suspended Shortcut
Activates a suspended Shortcut definition
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:
CellChangedInfo
Payload of the CellChanged event.
Fires when a cell value changes: an edit, a tick, an undo, an aggregation change, or a Calculated Column update. A live Alert rule does not fire this event; it fires AlertFired.
Extends , so adaptableApi is included.
The change: old and new values, column, row and what triggered it. See .
Custom application Context provided in AdaptableOptions.adaptableContext
This provides a single cellChange property of type CellDataChangedInfo defined as follows:
CellDataChangedInfo
Defines a Cell Edit - includes full details of old and new values, the column and the enclosing Row
number
Timestamp of change occurrence (in milliseconds)
AdaptableColumn<TData>
Column in which cell is situated
any
Value after the change.
Absent when trigger is live.
any
Value before the change.
Absent when trigger is live.
boolean
Whether the change was prevented by a validation rule
Primary Key Column's value for the row where edited cell is situated
TData
Data in the Row
IRowNode<TData>
AG Grid RowNode that contains the cell
'edit' | 'tick' | 'undo' | 'aggChange' | 'calculatedColumnChange' | 'live'
What triggered the change - user, background change, a reverted change, a
derived update on a Calculated Column whose source value changed, or a
live Alert rule turning true for the row (live: no old / new value,column is the rule's first Scope column when it has one).
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
});Find Out More
See Listening to Cell and Row Changes for a worked example