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:

MethodReturnsDescription
addAgGridColumnDefinition(columnDefinition)voidAdds 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()voidApplies current Filtering in AdapTable
clearAdaptableSorting()voidRemoves Column Sorts in AdapTable
clearFiltering()voidRemoves all current Filters in AdapTable
clearRowGroupColumns()voidClears Row Grouping in the Grid
closeTransposedView()voidCloses the transposed view of the Grid (if open)
collapseAllRowGroups()voidCollapse all open groups in Row Grouping
deleteGridData(dataRows, config)Promise<IRowNode[]>Deletes rows from AdapTable (and AG Grid)
deselectAll()voidDeselects all selected rows, cells and ranges
deSelectNode(rowNode, clearSelection)voidDeselects the AG Grid Row Node in AdapTable
deSelectNodes(rowNodes, clearSelection)voidAG Grid Row Nodes in AdapTable
deSelectRow(primaryKeyValue, clearSelection)voidDeselects Row with given Primary Key Value
deSelectRows(primaryKeyValues, clearSelection)voidDeselects Row with given Primary Key Values
expandAllRowGroups()voidExpands all closed groups in Row Grouping
expandRowGroupsForValues(columnValues)voidExpands Row Groups that contain given keys
getAgGridRowModelType()RowModelTypeReturns 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 | undefinedRetrieves Display Value for a given cell
getCellNormalisedValue(primaryKeyValue, columnId)any | undefinedRetrieves Normalised Value for a given cell
getCellRawValue(primaryKeyValue, columnId)any | undefinedRetrieves Raw Value for a given cell
getCellRawValueCount(columnId, rawValue)numberGets the count of the cells in a Column that have the given Raw Value
getCellSummaryInfo()CellSummmaryInfoReturns summary info on Selected Cells
getColumnCount()numberReturns number of columns in Data Source
getColumnData(columnId)any[]Retrieves all the values for a single Column.
getColumnSortForColumn(columnId)ColumnSort | undefinedRetrieves ColumnSort for a given Column
getColumnSorts()ColumnSort[]Returns Column Sort information in AdapTable
getDisplayValueFromRawValue(rowNode, columnId, rawValue)string | undefinedRetrieves Formatted Value for a given Raw Value in given Column
getDisplayValueFromRowNode(rowNode, columnId)any | undefinedRetrieves 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 | undefinedRetrieves the first Displayed Row Node in AdapTable
getFirstRowNode()IRowNode | undefinedRetrieves the first Row Node in AdapTable
getGridCellFromRowNode(rowNode, columnId)GridCell | undefinedRetrieves Cell in given Row and Column
getGridCellsForDisplayValue(columnId, displayValue)GridCell[] | undefinedReturns all the Grid Cells in a Column that have the given Display Value
getGridCellsForRawValue(columnId, rawValue)GridCell[] | undefinedReturns all the Grid Cells in a Column that have the given Raw Value
getGridContainerElement()HTMLElement | nullReturns 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()InternalStateReturns the Internal section from AdapTable State
getNormalisedValueFromRowNode(rowNode, columnId)any | undefinedRetrieves Normalised Value for Cell in given Row and Column
getPrimaryKeyValueForRowNode(rowNode)anyReturns 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 | undefinedRetrieves Raw Value for Cell in given Row and Column
getRowCount()numberReturns number of rows in Data Source
getRowNodeForIndex(rowIndex)IRowNode | undefinedRetrieves the displayed RowNode at the given index
getRowNodeForPrimaryKey(primaryKeyValue)IRowNodeRetrieves Row Node that contains given Primary Key
getRowNodesForPrimaryKeys(primaryKeyValues)IRowNode[]Retrieves Row Nodes that contain given Primary Keys
getSelectedCellInfo()SelectedCellInfoReturns all current Selected Cells in AdapTable
getSelectedRowInfo()SelectedRowInfoReturns all current Selected Rows in AdapTable
getVariant()AdaptableVariantReturns current AdapTable Variant: vanilla, angular, react, vue
getVisibleColumnCount()numberReturns 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()numberReturns 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)voidHighlights a Cell in AdapTable
highlightColumn(columnHighlightInfo)voidHighlights a Column in AdapTable
highlightRow(rowHighlightInfo)voidHighlight a row using an adaptable style
highlightRows(rowsHighlightInfo)voidHighlight rows using an adaptable style
isCellEditable(gridCell)booleanChecks if given Grid Cell is editable
isCellEdited(gridCell)booleanChecks if given Grid Cell has been edited (uses Data Change History)
isEveryCellEditable(gridCells)booleanChecks if all of given Grid Cells are editable
isGrandTotalRowNode(rowNode)booleanWhether given Row Node is a Grand Total Row
isGridGroupable()booleanWhether AdapTable instance can be Row Grouped
isGridInPivotMode()booleanWhether Grid is currently in Pivot Mode
isGridPivotable()booleanWhether AdapTable instance can be pivoted
isGridRangeSelectable()booleanWhether AdapTable instance offers cell range selection
isGridRowGrouped()booleanWhether Grid is currently showing Row Groups
isGridRowSelectable()booleanWhether AdapTable instance offers row selection
isGridRowSelected(primaryKeyValue)booleanWhether a Row is selected
isGroupRowNode(rowNode)booleanWhether given Row Node is a Row Group
isMasterDetailGrid()booleanWhether Grid is a Master Detail Grid
isQuickFilterAvailable()booleanWhether Quick Filter is available in the Grid
isSummaryNode(rowNode)booleanWhether given Row Node is in a Summary Row
isTreeDataGrid()booleanWhether Grid displays a Tree Data (structured hierarchical data)
isVisibleRowNode(rowNode)booleanWhether given Row Node is visible
jumpToCell(primaryKeyValue, columnId, rowNode)voidGrid will jump to cell in a given Row and Column
jumpToColumn(columnId)voidGrid will jump to Column that has given ColumnId
jumpToRow(primaryKeyValue)voidGrid will jump to Row containing given Primary Kev Value
loadGridData(data)voidLoads 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()voidOpens Settings Panel with Grid Info section selected and visible
redrawGrid()voidRedraws AdapTable (expensive operation so use sparingly)
refreshAllCells(forceUpdate)voidRefreshes all Cells in the Grid
refreshCell(rowNode, columnId, suppressFlash)voidRefresh a Cell Value in AdapTable
refreshCells(rowNode, columnIds, suppressFlash)voidRefresh Cell Values in AdapTable
refreshColumn(columnId)voidRefresh Column Values in AdapTable
refreshColumns(columnIds)voidRefresh Columns Values in AdapTable
refreshGridCell(gridCell)voidRefreshes a single Grid Cell
refreshGridCells(gridCells)voidRefreshes a set of Grid Cells
refreshGridHeader()voidForces a re-render of the Grid Header
refreshGroupRowNodes()voidForces a re-render of all Group Rows (including aggregations)
refreshRowByPrimaryKey(primaryKey)voidForces a re-render of Row with given Primary Key value
refreshRowNode(rowNode)voidForces a re-render of the given row
refreshRowNodes(rowNodes)voidForces re-render of given rows (if none provided, all rows are refreshed)
removeAgGridColumnDefinition(columnId)voidRemoves the Column Definition for a given Column.
selectAll()voidSelect the whole Grid
selectCellRange(gridCellRange, clearSelection)voidSelects a group of cells in a given range - provide either primary keys or row indexes
selectCellRangeByQuery(query, gridCellRange, clearSelection)voidSelects a group of cells in a given range using a query
selectColumn(columnId)voidSelects a Column in AG Grid
selectColumns(columnIds)voidSelects Columns in AG Grid
selectNode(rowNode, clearSelection)voidSelects the AG Grid Row Node in AdapTable
selectNodes(rowNodes, clearSelection)voidSelects the AG Grid Row Nodes in AdapTable
selectRow(primaryKeyValue, clearSelection)voidSelects Row with given Primary Key Value
selectRows(primaryKeyValues, clearSelection)voidSelects Rows with given Primary Key Values
setAdaptableSorting(columnSorts)voidSorts AdapTable using given Column Sorts
setAgGridColumnDefinitions(columnDefinitions)voidSets the Column Definitions for the Grid
setCellValue(cellUpdateRequest)voidUpdates cell in AdapTable (as an AG Grid edit)
setCellValues(cellUpdateRequests)voidUpdates multiple cells
setRowGroupColumns(columnIds)voidSets the grid to Row Group
showTransposedView(transposeConfig)voidOpens a window with a transposed view of Grid
undoCellEdit(cellDataChangedInfo)booleanReverses a data change (if triggered by cell edit)
unHighlightAllCells()voidUnhighlights all highlighted Cells in AdapTable
unHighlightAllColumns()voidUnhighlights all highlighted Columns in AdapTable
unHighlightAllRows()voidRemove all highlighted rows
unHighlightCell(primaryKeyValue, columnId)voidUnhighlights a Cell in AdapTable
unHighlightColumn(columnId)voidUnhighlights a Column in AdapTable
unHighlightRow(primaryKeyValue)voidRemove highlight from Row
unHighlightRows(primaryKeyValues)voidRemove highlight from given Rows
updateAgGridColumnDefinition(columnDefinition)voidUpdates Column Definition for given Column; use to update NON-STATEFUL AG Grid Column props (which are merged with existing Column Def)
updateAgGridColumnDefinitions(columnDefinitions)voidUpdates Column Definition for given Columns; use to update NON-STATEFUL AG Grid Column props (which are merged with existing Column Def)
updateAgGridColumnState(columnState)voidUpdates Ag Grid Column State for a given Column; use to update STATEFUL AG Grid Column props
updateAgGridColumnStates(columnStates)voidUpdates 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