Type alias ValueGetter<T>

ValueGetter<T>: ((row, context) => unknown)

Type Parameters

  • T = any

    the row type

Type declaration

    • (row, context): unknown
    • Computes the value of a calculated column from the row (ColumnDefIf.valueGetter). The row is the data object (in a tree the TreeRow.data). The data is not changed – sorting, filter (tableApi.getRowValue), copy, Excel and totals use the computed value.

      Keep it fast and free of side effects: it runs for every visible cell on each render (values are not cached) and once per row for sorting and totals.

      Parameters

      Returns unknown

      Example

      const total: ValueGetter<Item> = row => row.price * row.quantity;
      ColumnDef.create({ property: "total", headerLabel: "Total", valueGetter: total });

      Since

      1.1.95