Data updates
Supports full data replacement and ID-based transactions.
After resetting, inspect ORD-0001: quantity 10 and total 1,200.
View code
Sample data included in the code · 6 rows
Usage guide
#Changing an order quantity does not require recreating the whole table. Pass the order ID and new values to update that row.
Try it yourself
- Inspect the original value
After resetting, inspect ORD-0001: quantity 10 and total 1,200.
- Click Sample update
Sample update above the table increases the first order's quantity by 10. After one click, verify quantity 20 and total 2,400.
- Read the processing result
Inspect the applyTransaction() result below the table. Each click adds another 10, and Undo reverses changes.
The target order's quantity and calculated total change together. Its unchanged order ID continues to identify it.
This example updates browser sample data. Connect actual server saving separately. Pass a new rowData array to display a complete new query result.
Useful terms
- applyTransaction
- A method passing rows to add, update, and remove together to the Grid.
- getRowId
- A function returning each row's unique ID so the same row can be found after sorting changes its position.
Key API examples
Application code that references the registered Grid element as grid.
// getRowId identifies the same order.
const row = grid.rowData[0];
if (row) {
const result = await grid.applyTransaction({
update: [{ ...row, quantity: Number(row.quantity) + 10 }]
});
console.log(result);
}API reference
#Key properties
| Attribute / Property | Type / Default | Description |
|---|---|---|
| rowData | GridData[]Default: undefined | Row data — each entry is a plain object keyed by `ColumnDef.field`. Mutable so managed row drag can reassign a reordered array; the host observes the new order via the `rowMoved` event. |
| columnDefs | Array<ColumnDef | GridColumnGroupDef>Default: undefined | Column definitions in the standard shape. entries may also be nested groups (`{ headerName, children: [...] }`) — leaves drive every existing behaviour; groups add multi-level header rows. |
| defaultColDef | Partial<ColumnDef>Default: undefined | Defaults merged into every column def (right side wins). |
Events2
| Events | Detail type | Description |
|---|---|---|
GridRowDataChangedDetail | Fires after `applyTransaction` resolves its row diff. | |
GridCellValueChangedDetail | Fires once per changed cell on every `applyTransaction` update (AG Grid parity). |
Methods1
| Method / Arguments | Return type | Description |
|---|---|---|
| transaction: RowDataTransaction<GridRow>, label?: string, opts?: { source?: GridEditSource; origin?: unknown } | Promise<ApplyRowTransactionResult<GridRow>> | Apply a row-data transaction and emit its diff. |
ColumnDef3
| ColumnDef | Type / Required | Description |
|---|---|---|
GridFieldPath<TData>Required | Key on the row object — used to read the cell value when no `valueGetter`. | |
stringOptional | Stable public id. Falls back to `field`. | |
stringOptional | Header text. Falls back to `field` when omitted. |
Explore each feature
Learn when to use each feature and how to configure it. Each guide identifies live examples and features you connect in your app.