Handling Grid Data

View as Markdown

Summary

  • AdapTable provides Grid API methods which manage AG Grid data at runtime, including to:
    • Load Grid Data (including delayed / replacement loads)
    • Add, update or delete rows (individually or in a single transaction)
    • Set one or more Grid Cell values

The Grid API section of Adaptable API contains many functions to access AG Grid at run-time.

These include a series of data-management functions:

Important

  • We strongly recommend using these functions to update AG Grid, rather than the AG Grid API directly
  • Each function ultimately calls an AG Grid function, and around it AdapTable:
    • finds the rows by their Primary Key
    • reports every cell that changed, including in rows that are not rendered (AG Grid on its own reports changes only for rendered rows)
    • re-filters the Grid, refreshes columns that depend on every row and checks the selection once per call, rather than once per changed row

Most of these Grid API functions will do 2 things (that vary based on the use case):

  • update AG Grid using the relevant AG Grid api function
  • trigger an AdapTable Event - either Row Changed (with a Trigger) or Cell Changed

The full details are as follows:

Use CaseAdapTable FunctionAG Grid Function InvokedAdapTable EventTrigger
Loading Grid DataloadGridDatasetRowDataRow ChangedLoad
Managing RowsmanageGridDataapplyTransactionRow ChangedAdd / Update / Delete
Adding RowsaddGridDataapplyTransaction addRow ChangedAdd
Updating RowsupdateGridDataapplyTransaction updateRow ChangedUpdate
Add or Update RowsaddOrUpdateGridDataapplyTransaction add / updateRow ChangedAdd / Update
Deleting RowsdeleteGridDataapplyTransaction removeRow ChangedDelete
Setting Cell ValuessetCellValue / setCellValuesrowNode.setDataValueCell Changed

Note

The functions that invoke applyTransaction might call applyTransactionAsync based on the config they are given