Column formatter

Example
app.component.ts
users.ts
Name
Position
Team
Training
Company
Mark Ross
Team Leader
TI
13.00
Genco Pura Olive Oil Company
Concepción King
Carpenter
KN
33.00
Globex Corporation
Vanecia Green
Painter
CR
42.00
Soylent Corp
Samara Anderson
Electrician
PU
100.00
Initech
Maxine Hamilton
SEO Manager
KN
29.00
Gekko & Co
Dan Lee
Director
TI
92.00
Sterling Cooper
Paul Long
Web Developer
AN
13.00
Hooli
Madonna Snyder
Product Manager
DR
81.00
Vehement Capital Partners
Oriole Perkins
Public Relations
TI
72.00
Massive Dynamic
Ernest Jordan
Copywriter
TI
55.00
Wonka Industries
@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'
    }];


}
[
    {
        "name": "Mark Ross",
        "company": "Genco Pura Olive Oil Company",
        "position": "Team Leader",
        "teamSort": "TI",
        "training": 13,
        "budget": -7000
    }, ...
]

Column formatter - Inputs

InputTypeDefaultDescription
formatter(value: any, data: any) => any(v) => v Value formatter.

Related articles:

We use cookies to improve your experience. If you continue browsing, we assume that you consent to our use of cookies.