Selecting Grid Data

View as Markdown

Summary

  • AdapTable builds on the cell and row Selection in AG Grid by adding extra functionality including:
    • Full summary information of selected cells using multiple operations (including custom ones)
    • Methods in Grid API which allow cells and rows to be selected programmatically
    • The Selected Data Report which exports data about currently selected cells
    • A Selection Changed Event which provides full details about the current selection

Cell and Row Selection is an important and well-supported run-time user feature in AG Grid.

AdapTable provides many features which enhance and augment this.

Caution

  • Row Selection props are configured in AdapTable in Layouts (RowSelection); don't set gridOptions.rowSelection
  • Cell Selection requires the CellSelection AG Grid Module and cellSelection in GridOptions

Note

  • This section is about using a selection — API, events, export and Cell Summaries etc.
  • Checkbox column and row-selection behaviour is described in Row Selection in Table Layouts

Cell and Row Selection Topics

Cell and row selection is documented in several places, depending on the use case:

TopicSummary
Exporting Grid Data (Selected Cells report)Export the current cell/row selection
Selecting Using Grid API FunctionsselectCellRange, expressions, columns, rows, select all
Selection Changed EventsCellSelectionChanged and RowSelectionChanged demos
Row Selection in Table LayoutsCheckboxes, mode, header checkbox, click behaviour, grouping (RowSelection on the Layout) — do not set gridOptions.rowSelection
Summarising CellsCell Summary for the current selection
Selecting Technical ReferenceEvent payloads and subscription
Highlighting & Jumping CellsOften used together with selection-driven behaviour

AdapTable builds on the selection capabilities of AG Grid by providing these additional features:

  • Displaying (customisable) Cell Summary information of selected cells
  • Grid API functions enable run-time selection and highlighting of cells
  • Selected Cells Report is available to export selected data

Exporting Cell Selection

A common requirement is to select a range of cells or rows and export them from AG Grid to another location.

AdapTable wraps up the current cell and row selection in the Selected Cells System Report.

The Selected Cells (System) Report is available for export in 2 ways:

Caution

Using the Context Menu item exports the Report to Excel only

  • Selecting the Report in the Export Toolbar, ToolPanel or Status Bar

Note

This will export the selected data to any available export destination

Selecting through API

The Grid API includes many helpful selection related functions, including:

  • selecting cell ranges using row indexes or primary keys (with timeouts)
  • selecting columns
  • unselecting cells or columns

Find Out More

See Selecting Using Grid API Functions for more information and multiple demos

Selection Changed Event

AdapTable fires the Selection Changed Event whenever the cell or row selection in AG Grid changes.

This provides very detailed information of the new Grid selection.

Selected Cells Summaries

AdapTable's Cell Summary Module provides comprehensive information about the currently selected Cells.

This includes a number of Summary Operations provided by AdapTable (e.g. sum, count, average etc) and custom summary operations provided by developers.

Note

Selected cells in pinned rows (Row Summaries, a pinned Grand Total Row, or rows pinned with AG Grid Row Pinning) are not included in the selected cell information or the Cell Summary. A range that reaches into the pinned rows covers the body rows up to the top or bottom of the grid, and a pinned row's own body row is counted once if the range covers it.

Find Out More

See Summarising Selected Cells for full details

Configuring Row Selection

How rows are selected — single vs multi, the checkbox Selection Column, click behaviour, grouping — is configured on the Layout, not in this section.

Find Out More

See Row Selection in Table Layouts for the full RowSelection options, checkbox visibility, and demos

FAQ

Why am I unable to select a range of cells? Register the CellSelection AG Grid Module and set cellSelection in GridOptions. Row selection (mode, checkboxes, click behaviour) is configured on the Layout — do not set gridOptions.rowSelection.

Does selection affect Bulk Update? Bulk Update runs on whatever cells you have selected in editable columns — see that topic for UI entry points and behaviour.

AdapTable Resources