Server-Side Row Model - Managing Data
Summary
- AG Grid rows can be added, updated and deleted through AdapTable API methods when using the Server-Side Row Model
- These functions will, in turn, invoke the relevant AG Grid functions
The Server-Side Row Model adds and updates rows using the same Grid API row management functions as when using the Client Side Row Model, namely:
addGridData– to add Grid RowsupdateGridData- to update Grid RowsdeleteGridData- to delete Grid Rows
AdapTable, in turn, invokes the AG Grid applyServerSideTransaction or applyServerSideTransactionAsync functions as appropriate.
Note
You can also use the setCellValue and setCellValues in Grid API to update individual cells, but this is rarely done
Updating Rows
SSRM - Updating Rows
- This demo includes a Custom Dashboard Toolbar with 2 Buttons that call Grid API methods:
- Update First Row - updates the first row using
updateGridData - Update Second Row - updates
GoldandBronzecolumns in second row usingsetCallValue
- Update First Row - updates the first row using
- We leverage Cell Flashing to make it easy to see which cells have changed
Adding Rows
The addGridData function in Grid API will add new Rows to the Grid while using the Server-Side Row Model.
Hint
When adding data, include the addIndex property in the DataUpdateConfig object if the new row should be visible
SSRM - Adding Rows
- This demo includes a Custom Dashboard Toolbar with a Button which adds a new row at the top of the grid
- We added a
ROW_ADDEDObservable Alert to tell the user the row was inserted