Row detail

Example
app.component.ts
app.component.css
users.ts
Name
Position
Team
Training
Company
Mark Ross
Team Leader
TI
13
Genco Pura Olive Oil Company
Concepción King
Carpenter
KN
33
Globex Corporation
Vanecia Green
Painter
CR
42
Soylent Corp
Samara Anderson
Electrician
PU
100
Initech
Maxine Hamilton
SEO Manager
KN
29
Gekko & Co
Dan Lee
Director
TI
92
Sterling Cooper
Paul Long
Web Developer
AN
13
Hooli
Madonna Snyder
Product Manager
DR
81
Vehement Capital Partners
Oriole Perkins
Public Relations
TI
72
Massive Dynamic
Ernest Jordan
Copywriter
TI
55
Wonka Industries
import { Component } from '@angular/core';

@Component({
	template: `
		<gui-grid [source]="users"
				  [columns]="columns"
				  [rowDetail]="rowDetail">
		</gui-grid>
	`
})
export class RowDetailComponent {

	users = users;

	columns: Array<GuiColumn> = [{
        header: 'Name',
        field: 'name'
    }, {
        header: 'Position',
        field: 'position'
    }, {
        header: 'Team',
        field: 'teamShort',
        width: 80
    }, {
        header: 'Training',
        field: 'training',
        type: GuiDataType.NUMBER,
        width: 100
    }, {
        header: 'Company',
        field: 'company'
    }];
			
	rowDetail: GuiRowDetail = {
		enabled: true,
		template: (item) => {
	
		return `
			<div class='user-detail'>
				<h1>${item.name}</h1>
				
				<img src='${item.avatar}' />
				
				<h2>${item.company}</h2>
				<h3>${item.position}</h3>
				<div><b>Team:</b> ${item.team.name}</div>
			</div>`;
		}
	 };
	
	
}
.user-detail {
	padding: 20px;
	min-width: 300px;
	font-family: Lato;
}

.user-detail img {
	height: 160px;
}

.user-detail div {
	display: block;
	margin-top: 16px;
	font-size: 16px;
}

.user-detail h1 {
	font-size: 2.0rem;
	font-weight: 500;

}

.user-detail h2 {
	font-size: 1.5rem;
	font-weight: 300;
	margin-top: 16px;
}

.user-detail h3 {
	font-size: 1.2rem;
	font-weight: 300;
	margin-top: 16px;
}
[
    {
        "name": "Mark Ross",
        "company": "Genco Pura Olive Oil Company",
        "position": "Team Leader",
        "teamSort": "TI",
        "training": 13,
        "budget": -7000
    }, ...
]

Row detail - Inputs

export interface GuiRowDetail {

	enabled?: boolean;

	template?: (item: any, index: number) => string;

}
InputTypeDefaultDescription
rowDetailGuiRowDetail'' Row detail configuration object.
enabledbooleanfalse Enabled row detail
templatefunction(item) {}'' Template function

Related articles:









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