Skip to content

Commit 314015b

Browse files
committed
fix(igxTreeGrid): Fixes commented issues #6640
1 parent fc52c41 commit 314015b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.pipes.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export class IgxTreeGridHierarchizingPipe implements PipeTransform {
3131
const treeGridRecordsMap = new Map<any, ITreeGridRecord>();
3232
const flatData: any[] = [];
3333

34-
if (primaryKey && foreignKey) {
34+
if (pinned) {
35+
hierarchicalRecords = this.normalizePinnedRecords(collection, primaryKey);
36+
} else if (primaryKey && foreignKey) {
3537
hierarchicalRecords = this.hierarchizeFlatData(id, collection, primaryKey, foreignKey, treeGridRecordsMap, flatData);
3638
} else if (childDataKey) {
3739
hierarchicalRecords = this.hierarchizeRecursive(id, collection, primaryKey, childDataKey, undefined,
@@ -121,6 +123,19 @@ export class IgxTreeGridHierarchizingPipe implements PipeTransform {
121123

122124
return result;
123125
}
126+
127+
private normalizePinnedRecords(collection: any[], primaryKey: string) {
128+
const result: ITreeGridRecord[] = [];
129+
collection.forEach(row => {
130+
const record: ITreeGridRecord = {
131+
rowID: this.getRowID(primaryKey, row),
132+
data: row,
133+
children: []
134+
};
135+
result.push(record);
136+
});
137+
return result;
138+
}
124139
}
125140

126141
/**

0 commit comments

Comments
 (0)