Interface ValueGetterContextIf

The second parameter of a ValueGetter: access to other columns of the same table – also calculated ones – and to column aggregates over the (filtered) rows. Formulas (compileFormula) use it for [total] and SUM([total]).

Example

ColumnDef.create({
property: "share", headerLabel: "Share",
valueGetter: (row: Item, ctx: ValueGetterContextIf) =>
Number(ctx.getValue(row, "total")) / Number(ctx.aggregate("total", "sum"))
});

Since

1.1.95

Hierarchy

  • ValueGetterContextIf

Properties

property: string

The property of the column that is computed.

Methods

  • An aggregate of a column over the filtered rows of the body (cached until the data, filter or sorting changes), e.g. aggregate("total", "sum"). Values that are no numbers are skipped (see Aggregators).

    Parameters

    Returns unknown

  • The value of another column of the row: its valueGetter (with protection against circular references – a cycle returns a #CIRC! FormulaError) or the property path.

    Parameters

    • row: any
    • property: string

    Returns unknown