Computes count, sum, average, minimum and maximum of the selected body cells (SelectionAggregatesIf) – what TableApi.getSelectionAggregates returns, e.g. for a status bar under the table.

Counted are the selected cells of the visible data columns (no row numbers, no checkbox column); the numbers are the cell values (getValueAt) of type number. Negative ranges (Ctrl/⌘-click) are respected. A selection whose ranges cover more than maxCells cells is not computed (capped: true).

Example

SelectionAggregator.maxCells = 5_000_000;            // allow bigger selections
const a = new SelectionAggregator().aggregate(tableModel, selectionModel);

Since

1.1.94

Hierarchy

  • SelectionAggregator

Constructors

Properties

Methods

Constructors

Properties

maxCells: number = 1_000_000

Upper limit for the cells of the selected ranges (Ctrl+A on millions of rows). Like CopyService.maxCopyCells: above it nothing is computed.

Example

SelectionAggregator.maxCells = 2_000_000;

Methods