Column formatter

Example
column-formatter.js
column-formatter.html
users.ts
$('#columns-formatter').guiGrid({
	
	
	columns: [{
        header: 'Name',
        field: 'name',
    }, {
        header: 'Position',
        field: 'position',
    }, {
        header: 'Team',
        field: 'teamShort',
        width: 80,
    }, {
        header: 'Training',
        field: 'training',
        type: 'number',
        width: 100,
        formatter: (v) => v.toFixed(2)
    }, {
        header: 'Company',
        field: 'company',
    }],

	source: [...users]

});
<div id='column-formatter'></div>
[
    {
        "id": "#1",
        "name": "Mark Ross",
        "company": "Genco Pura Olive Oil Company",
        "position": "Team Leader",
        "teamSort": "TI",
        "training": 13,
        "budget": -7000
    }, ...
]

Column formatter - options

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

Related articles: