Skip to content

Commit 8f0b9ff

Browse files
authored
Merge pull request #3714 from IgniteUI/simeonoff/fix-3661-master
fix(grid-pinning): custom pin icon not showing in styling sample
2 parents dd97b0d + 2133a89 commit 8f0b9ff

File tree

1 file changed

+50
-21
lines changed

1 file changed

+50
-21
lines changed

src/app/grid/grid-sample-pinning-styling/grid-pinning-styling.component.ts

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,62 @@
1-
import { Component, ViewChild, ViewEncapsulation, OnInit } from '@angular/core';
2-
import { IgxColumnComponent, IgxGridComponent, IgxCellHeaderTemplateDirective, IgxIconComponent } from 'igniteui-angular';
3-
import { DATA } from '../../data/customers';
4-
import { IgxPreventDocumentScrollDirective } from '../../directives/prevent-scroll.directive';
5-
1+
import { Component, ViewChild, OnInit, inject } from "@angular/core";
2+
import {
3+
IgxColumnComponent,
4+
IgxGridComponent,
5+
IgxCellHeaderTemplateDirective,
6+
IgxIconComponent,
7+
IgxIconService
8+
} from "igniteui-angular";
9+
import { DATA } from "../../data/customers";
10+
import { IgxPreventDocumentScrollDirective } from "../../directives/prevent-scroll.directive";
611

712
@Component({
8-
selector: 'app-grid-sample',
9-
styleUrls: ['grid-pinning-styling.component.scss'],
10-
templateUrl: 'grid-pinning-styling.component.html',
11-
imports: [IgxGridComponent, IgxPreventDocumentScrollDirective, IgxColumnComponent, IgxCellHeaderTemplateDirective, IgxIconComponent]
13+
selector: "app-grid-sample",
14+
styleUrls: ["grid-pinning-styling.component.scss"],
15+
templateUrl: "grid-pinning-styling.component.html",
16+
imports: [
17+
IgxGridComponent,
18+
IgxPreventDocumentScrollDirective,
19+
IgxColumnComponent,
20+
IgxCellHeaderTemplateDirective,
21+
IgxIconComponent
22+
]
1223
})
24+
export class PinningStylingComponent implements OnInit {
25+
private iconService = inject(IgxIconService);
26+
@ViewChild("grid1", { static: true }) public grid1: IgxGridComponent;
1327

14-
export class PinningStylingComponent implements OnInit{
15-
@ViewChild('grid1', { static: true }) public grid1: IgxGridComponent;
28+
constructor() {
29+
this.iconService.setFamily("fas", {
30+
className: "fas",
31+
type: "font",
32+
prefix: "fa-"
33+
});
34+
}
1635

1736
public data: any[];
1837
public columns: any[];
1938
public ngOnInit(): void {
2039
this.columns = [
21-
{ field: 'ID', header: 'ID', width: 100, hidden: true },
22-
{ field: 'CompanyName', header: 'Company Name', width: 300 },
23-
{ field: 'ContactName', header: 'Contact Name', width: 200, pinned: true },
24-
{ field: 'ContactTitle', header: 'Contact Title', width: 200, pinned: true },
25-
{ field: 'Address', header: 'Address', width: 300 },
26-
{ field: 'City', header: 'City', width: 120 },
27-
{ field: 'Region', header: 'Region', width: 120 },
28-
{ field: 'PostalCode', header: 'Postal Code', width: 150 },
29-
{ field: 'Phone', header: 'Phone', width: 150 },
30-
{ field: 'Fax', header: 'Fax', width: 150 }
40+
{ field: "ID", header: "ID", width: 100, hidden: true },
41+
{ field: "CompanyName", header: "Company Name", width: 300 },
42+
{
43+
field: "ContactName",
44+
header: "Contact Name",
45+
width: 200,
46+
pinned: true
47+
},
48+
{
49+
field: "ContactTitle",
50+
header: "Contact Title",
51+
width: 200,
52+
pinned: true
53+
},
54+
{ field: "Address", header: "Address", width: 300 },
55+
{ field: "City", header: "City", width: 120 },
56+
{ field: "Region", header: "Region", width: 120 },
57+
{ field: "PostalCode", header: "Postal Code", width: 150 },
58+
{ field: "Phone", header: "Phone", width: 150 },
59+
{ field: "Fax", header: "Fax", width: 150 }
3160
];
3261
this.data = DATA;
3362
}

0 commit comments

Comments
 (0)