Column formatter
Name
Position
Team
Training
Company
13.00
33.00
42.00
100.00
29.00
92.00
13.00
81.00
72.00
55.00
@Component({
template: `
<gui-grid [source]="users"
[columns]="columns">
</gui-grid>
`
})
export class ColumnFormatterComponent {
users = users;
columns = [{
header: 'Name',
field: 'name'
}, {
header: 'Position',
field: 'position'
}, {
header: 'Team',
field: 'teamShort',
width: 80
}, {
header: 'Training',
field: 'training',
type: GuiDataType.NUMBER,
width: 100,
formatter: (v) => v.toFixed(2)
}, {
header: 'Company',
field: 'company'
}];
}
[
{
"id": "#1",
"name": "Mark Ross",
"company": "Genco Pura Olive Oil Company",
"position": "Team Leader",
"teamSort": "TI",
"training": 13,
"budget": -7000
}, ...
]
Column formatter - Inputs
Input | Type | Default | Description |
---|---|---|---|
formatter | (value: any, data: any) => any | (v) => v | Value formatter. |