Grid Data Technical Reference
Summary
- Grid API contains many useful functions to manage Grid Data
Grid API
The Grid API section of Adaptable API contains a wealth of functions that allow you to access the Grid in a number of ways:
| Method | Returns | Description |
|---|---|---|
| addAgGridColumnDefinition(columnDefinition) | void | Adds a Column Definition to the Grid |
| addGridData(dataRows, config) | Promise<IRowNode[]> | Adds rows to AdapTable (and AG Grid) |
| addOrUpdateGridData(dataRows, config) | Promise<\{ addedRows: IRowNode[]; updatedRows: IRowNode[]; \}> | Adds or Updates AdapTable (and AG Grid) with new and changed rows |
| applyFiltering() | void | Applies current Filtering in AdapTable |
| clearAdaptableSorting() | void | Removes Column Sorts in AdapTable |
| clearFiltering() | void | Removes all current Filters in AdapTable |
| clearRowGroupColumns() | void | Clears Row Grouping in the Grid |
| closeTransposedView() | void | Closes the transposed view of the Grid (if open) |
| collapseAllRowGroups() | void | Collapse all open groups in Row Grouping |
| deleteGridData(dataRows, config) | Promise<IRowNode[]> | Deletes rows from AdapTable (and AG Grid) |
| deselectAll() | void | Deselects all selected rows, cells and ranges |
| deSelectNode(rowNode, clearSelection) | void | Deselects the AG Grid Row Node in AdapTable |
| deSelectNodes(rowNodes, clearSelection) | void | AG Grid Row Nodes in AdapTable |
| deSelectRow(primaryKeyValue, clearSelection) | void | Deselects Row with given Primary Key Value |
| deSelectRows(primaryKeyValues, clearSelection) | void | Deselects Row with given Primary Key Values |
| expandAllRowGroups() | void | Expands all closed groups in Row Grouping |
| expandRowGroupsForValues(columnValues) | void | Expands Row Groups that contain given keys |
| getAgGridRowModelType() | RowModelType | Returns AG Grid Row Model Type |
| getAllAgGridColumns() | Column<any>[] | Return all AG Grid columns |
| getAllRowNodes(config) | IRowNode[] | Retrieves all Row Nodes currently in the Grid (by default excluding the group rows) |
| getCellDisplayValue(primaryKeyValue, columnId) | any | undefined | Retrieves Display Value for a given cell |
| getCellNormalisedValue(primaryKeyValue, columnId) | any | undefined | Retrieves Normalised Value for a given cell |
| getCellRawValue(primaryKeyValue, columnId) | any | undefined | Retrieves Raw Value for a given cell |
| getCellRawValueCount(columnId, rawValue) | number | Gets the count of the cells in a Column that have the given Raw Value |
| getCellSummaryInfo() | CellSummmaryInfo | Returns summary info on Selected Cells |
| getColumnCount() | number | Returns number of columns in Data Source |
| getColumnData(columnId) | any[] | Retrieves all the values for a single Column. |
| getColumnSortForColumn(columnId) | ColumnSort | undefined | Retrieves ColumnSort for a given Column |
| getColumnSorts() | ColumnSort[] | Returns Column Sort information in AdapTable |
| getDisplayValueFromRawValue(rowNode, columnId, rawValue) | string | undefined | Retrieves Formatted Value for a given Raw Value in given Column |
| getDisplayValueFromRowNode(rowNode, columnId) | any | undefined | Retrieves Display Value for Cell in given Row and Column |
| getFilteredColumnData(columnId) | any[] | Retrieves the filtered values for a single Column. |
| getFilteredData() | any[] | Retrieves filtered data from the grid |
| getFirstDisplayedRowNode() | IRowNode | undefined | Retrieves the first Displayed Row Node in AdapTable |
| getFirstRowNode() | IRowNode | undefined | Retrieves the first Row Node in AdapTable |
| getGridCellFromRowNode(rowNode, columnId) | GridCell | undefined | Retrieves Cell in given Row and Column |
| getGridCellsForDisplayValue(columnId, displayValue) | GridCell[] | undefined | Returns all the Grid Cells in a Column that have the given Display Value |
| getGridCellsForRawValue(columnId, rawValue) | GridCell[] | undefined | Returns all the Grid Cells in a Column that have the given Raw Value |
| getGridContainerElement() | HTMLElement | null | Returns the Grid Container in which the AdapTable Instance is present |
| getGridData() | any[] | Retrieves all data from the grid |
| getGroupRowNodes(config) | IRowNode[] | Retrieves all Grouped Row Nodes currently in the Grid |
| getInternalState() | InternalState | Returns the Internal section from AdapTable State |
| getNormalisedValueFromRowNode(rowNode, columnId) | any | undefined | Retrieves Normalised Value for Cell in given Row and Column |
| getPrimaryKeyValueForRowNode(rowNode) | any | Returns the Primary Kev Value for a given Row Node |
| getPrimaryKeyValuesForRowNodes(rowNodes) | any[] | Returns the Primary Kev Values for a given Row Node collection |
| getRawValueFromRowNode(rowNode, columnId) | any | undefined | Retrieves Raw Value for Cell in given Row and Column |
| getRowCount() | number | Returns number of rows in Data Source |
| getRowNodeForIndex(rowIndex) | IRowNode | undefined | Retrieves the displayed RowNode at the given index |
| getRowNodeForPrimaryKey(primaryKeyValue) | IRowNode | Retrieves Row Node that contains given Primary Key |
| getRowNodesForPrimaryKeys(primaryKeyValues) | IRowNode[] | Retrieves Row Nodes that contain given Primary Keys |
| getSelectedCellInfo() | SelectedCellInfo | Returns all current Selected Cells in AdapTable |
| getSelectedRowInfo() | SelectedRowInfo | Returns all current Selected Rows in AdapTable |
| getVariant() | AdaptableVariant | Returns current AdapTable Variant: vanilla, angular, react, vue |
| getVisibleColumnCount() | number | Returns number of visible columns in Data Source |
| getVisibleColumnData(columnId) | any[] | Retrieves the visible (filtered and sorted) values for a single Column. |
| getVisibleData() | any[] | Retrieves visible data from the grid (filtered and sorted) |
| getVisibleRowCount() | number | Returns number of rows in Data Source |
| getVisibleRowNodes(config) | IRowNode[] | Retrieves all filtered Row Nodes currently in the Grid (i.e. after applying the current filter) |
| highlightCell(cellHighlightInfo) | void | Highlights a Cell in AdapTable |
| highlightColumn(columnHighlightInfo) | void | Highlights a Column in AdapTable |
| highlightRow(rowHighlightInfo) | void | Highlight a row using an adaptable style |
| highlightRows(rowsHighlightInfo) | void | Highlight rows using an adaptable style |
| isCellEditable(gridCell) | boolean | Checks if given Grid Cell is editable |
| isCellEdited(gridCell) | boolean | Checks if given Grid Cell has been edited (uses Data Change History) |
| isEveryCellEditable(gridCells) | boolean | Checks if all of given Grid Cells are editable |
| isGrandTotalRowNode(rowNode) | boolean | Whether given Row Node is a Grand Total Row |
| isGridGroupable() | boolean | Whether AdapTable instance can be Row Grouped |
| isGridInPivotMode() | boolean | Whether Grid is currently in Pivot Mode |
| isGridPivotable() | boolean | Whether AdapTable instance can be pivoted |
| isGridRangeSelectable() | boolean | Whether AdapTable instance offers cell range selection |
| isGridRowGrouped() | boolean | Whether Grid is currently showing Row Groups |
| isGridRowSelectable() | boolean | Whether AdapTable instance offers row selection |
| isGridRowSelected(primaryKeyValue) | boolean | Whether a Row is selected |
| isGroupRowNode(rowNode) | boolean | Whether given Row Node is a Row Group |
| isMasterDetailGrid() | boolean | Whether Grid is a Master Detail Grid |
| isQuickFilterAvailable() | boolean | Whether Quick Filter is available in the Grid |
| isSummaryNode(rowNode) | boolean | Whether given Row Node is in a Summary Row |
| isTreeDataGrid() | boolean | Whether Grid displays a Tree Data (structured hierarchical data) |
| isVisibleRowNode(rowNode) | boolean | Whether given Row Node is visible |
| jumpToCell(primaryKeyValue, columnId, rowNode) | void | Grid will jump to cell in a given Row and Column |
| jumpToColumn(columnId) | void | Grid will jump to Column that has given ColumnId |
| jumpToRow(primaryKeyValue) | void | Grid will jump to Row containing given Primary Kev Value |
| loadGridData(data) | void | Loads data into grid and fire a RowChanged.trigger='Load' event |
| manageGridData(dataRowConfig, dataUpdateConfig) | Promise<\{ addedRows: IRowNode[]; updatedRows: IRowNode[]; removedRows: IRowNode[]; \}> | Adds, Updates or Deletes rows in AdapTable (and AG Grid) in single transaction |
| openGridInfoSettingsPanel() | void | Opens Settings Panel with Grid Info section selected and visible |
| redrawGrid() | void | Redraws AdapTable (expensive operation so use sparingly) |
| refreshAllCells(forceUpdate) | void | Refreshes all Cells in the Grid |
| refreshCell(rowNode, columnId, suppressFlash) | void | Refresh a Cell Value in AdapTable |
| refreshCells(rowNode, columnIds, suppressFlash) | void | Refresh Cell Values in AdapTable |
| refreshColumn(columnId) | void | Refresh Column Values in AdapTable |
| refreshColumns(columnIds) | void | Refresh Columns Values in AdapTable |
| refreshGridCell(gridCell) | void | Refreshes a single Grid Cell |
| refreshGridCells(gridCells) | void | Refreshes a set of Grid Cells |
| refreshGridHeader() | void | Forces a re-render of the Grid Header |
| refreshGroupRowNodes() | void | Forces a re-render of all Group Rows (including aggregations) |
| refreshRowByPrimaryKey(primaryKey) | void | Forces a re-render of Row with given Primary Key value |
| refreshRowNode(rowNode) | void | Forces a re-render of the given row |
| refreshRowNodes(rowNodes) | void | Forces re-render of given rows (if none provided, all rows are refreshed) |
| removeAgGridColumnDefinition(columnId) | void | Removes the Column Definition for a given Column. |
| selectAll() | void | Select the whole Grid |
| selectCellRange(gridCellRange, clearSelection) | void | Selects a group of cells in a given range - provide either primary keys or row indexes |
| selectCellRangeByQuery(query, gridCellRange, clearSelection) | void | Selects a group of cells in a given range using a query |
| selectColumn(columnId) | void | Selects a Column in AG Grid |
| selectColumns(columnIds) | void | Selects Columns in AG Grid |
| selectNode(rowNode, clearSelection) | void | Selects the AG Grid Row Node in AdapTable |
| selectNodes(rowNodes, clearSelection) | void | Selects the AG Grid Row Nodes in AdapTable |
| selectRow(primaryKeyValue, clearSelection) | void | Selects Row with given Primary Key Value |
| selectRows(primaryKeyValues, clearSelection) | void | Selects Rows with given Primary Key Values |
| setAdaptableSorting(columnSorts) | void | Sorts AdapTable using given Column Sorts |
| setAgGridColumnDefinitions(columnDefinitions) | void | Sets the Column Definitions for the Grid |
| setCellValue(cellUpdateRequest) | void | Updates cell in AdapTable (as an AG Grid edit) |
| setCellValues(cellUpdateRequests) | void | Updates multiple cells |
| setRowGroupColumns(columnIds) | void | Sets the grid to Row Group |
| showTransposedView(transposeConfig) | void | Opens a window with a transposed view of Grid |
| undoCellEdit(cellDataChangedInfo) | boolean | Reverses a data change (if triggered by cell edit) |
| unHighlightAllCells() | void | Unhighlights all highlighted Cells in AdapTable |
| unHighlightAllColumns() | void | Unhighlights all highlighted Columns in AdapTable |
| unHighlightAllRows() | void | Remove all highlighted rows |
| unHighlightCell(primaryKeyValue, columnId) | void | Unhighlights a Cell in AdapTable |
| unHighlightColumn(columnId) | void | Unhighlights a Column in AdapTable |
| unHighlightRow(primaryKeyValue) | void | Remove highlight from Row |
| unHighlightRows(primaryKeyValues) | void | Remove highlight from given Rows |
| updateAgGridColumnDefinition(columnDefinition) | void | Updates Column Definition for given Column; use to update NON-STATEFUL AG Grid Column props (which are merged with existing Column Def) |
| updateAgGridColumnDefinitions(columnDefinitions) | void | Updates Column Definition for given Columns; use to update NON-STATEFUL AG Grid Column props (which are merged with existing Column Def) |
| updateAgGridColumnState(columnState) | void | Updates Ag Grid Column State for a given Column; use to update STATEFUL AG Grid Column props |
| updateAgGridColumnStates(columnStates) | void | Updates Ag Grid Column State for given Columns; use to update STATEFUL AG Grid Column props |
| updateGridData(dataRows, config) | Promise<IRowNode[]> | Updates AdapTable (and AG Grid) with rows that have changed |