mates-grid
Column Definitions
Each ColDef is a field, a header, and optional width, pin, formatter, filter, and renderer. Cells are text unless you supply cellRenderer.
Fields, headers, and formatters
headerName defaults to a humanized field. valueFormatter only changes display — sort and filter still use the raw value.
Name
ID
Region
Status
Year
Amount
Qty
Joined
USD
Ada Lovelace
1
EMEA
Active
2022
$20
1
2024-01-01
$20
Grace Hopper
2
APAC
Pending
2023
$57
2
2024-02-02
$57
Linus Torvalds
3
Americas
Churned
2024
$94
3
2024-03-03
$94
Margaret Hamilton
4
EMEA
Active
2022
$131
4
2024-04-04
$131
Dennis Ritchie
5
APAC
Pending
2023
$168
5
2024-05-05
$168
Barbara Liskov
6
Americas
Churned
2024
$205
6
2024-06-06
$205
Alan Turing
7
EMEA
Active
2022
$242
7
2024-07-07
$242
Katherine Johnson
8
APAC
Pending
2023
$279
8
2024-08-08
$279
Donald Knuth
9
Americas
Churned
2024
$316
9
2024-09-09
$316
Radia Perlman
10
EMEA
Active
2022
$353
1
2024-10-10
$353
Ken Thompson
11
APAC
Pending
2023
$390
2
2024-11-11
$390
Frances Allen
12
Americas
Churned
2024
$427
3
2024-12-12
$427
Ada Lovelace
13
EMEA
Active
2022
$464
4
2024-01-13
$464
Grace Hopper
14
APAC
Pending
2023
$21
5
2024-02-14
$21
Linus Torvalds
15
Americas
Churned
2024
$58
6
2024-03-15
$58
Margaret Hamilton
16
EMEA
Active
2022
$95
7
2024-04-16
$95
Dennis Ritchie
17
APAC
Pending
2023
$132
8
2024-05-17
$132
Barbara Liskov
18
Americas
Churned
2024
$169
9
2024-06-18
$169
{ field: "amount", headerName: "USD", valueFormatter: ({ value }) =>
`$${Number(value).toLocaleString()}` }
Computed columns
Use valueGetter when the cell is not a raw field. Give it a colId so sort, filter, and pin have a stable identity.
Name
Unit price
Status
Ada Lovelace
$20.00
Active
Grace Hopper
$28.50
Pending
Linus Torvalds
$31.33
Churned
Margaret Hamilton
$32.75
Active
Dennis Ritchie
$33.60
Pending
Barbara Liskov
$34.17
Churned
Alan Turing
$34.57
Active
Katherine Johnson
$34.88
Pending
Donald Knuth
$35.11
Churned
Radia Perlman
$353.00
Active
Ken Thompson
$195.00
Pending
Frances Allen
$142.33
Churned
Ada Lovelace
$116.00
Active
Grace Hopper
$4.20
Pending
Linus Torvalds
$9.67
Churned
Margaret Hamilton
$13.57
Active
{
colId: "unit",
headerName: "Unit price",
valueGetter: ({ data }) => Number(data.amount) / Number(data.qty),
}