@@ -54,22 +54,20 @@ export class IgxTreeGridHierarchizingPipe implements PipeTransform {
54
54
const result : ITreeGridRecord [ ] = [ ] ;
55
55
const missingParentRecords : ITreeGridRecord [ ] = [ ] ;
56
56
collection . forEach ( row => {
57
- const ghostRow = row . ghostRec !== undefined ;
58
57
const record : ITreeGridRecord = {
59
- rowID : ghostRow ? this . getRowID ( primaryKey , row . recordData ) : this . getRowID ( primaryKey , row ) ,
58
+ rowID : this . getRowID ( primaryKey , row ) ,
60
59
data : row ,
61
60
children : [ ]
62
61
} ;
63
- const parent = ghostRow ? map . get ( row . recordData [ foreignKey ] ) : map . get ( row [ foreignKey ] ) ;
62
+ const parent = map . get ( row [ foreignKey ] ) ;
64
63
if ( parent ) {
65
64
record . parent = parent ;
66
65
parent . children . push ( record ) ;
67
66
} else {
68
67
missingParentRecords . push ( record ) ;
69
68
}
70
69
71
- ghostRow ? map . set ( row . recordData [ primaryKey ] , record ) :
72
- map . set ( row [ primaryKey ] , record ) ;
70
+ map . set ( row [ primaryKey ] , record ) ;
73
71
} ) ;
74
72
75
73
missingParentRecords . forEach ( record => {
@@ -92,7 +90,7 @@ export class IgxTreeGridHierarchizingPipe implements PipeTransform {
92
90
const record = collection [ i ] ;
93
91
record . level = indentationLevel ;
94
92
record . expanded = this . gridAPI . get_row_expansion_state ( record ) ;
95
- this . gridAPI . grid . isGhostRecord ( record . data ) ? flatData . push ( record . data . recordData ) : flatData . push ( record . data ) ;
93
+ flatData . push ( record . data ) ;
96
94
97
95
if ( record . children && record . children . length > 0 ) {
98
96
this . setIndentationLevels ( id , record . children , indentationLevel + 1 , flatData ) ;
@@ -364,16 +362,18 @@ export class IgxTreeGridShadowRowsPipe implements PipeTransform {
364
362
}
365
363
366
364
transform ( collection : any [ ] , id : string , pipeTrigger : number ) : any [ ] {
365
+ this . designateDisabledRows ( collection ) ;
366
+ return collection ;
367
+ }
367
368
368
- const result = [ ] ;
369
-
370
- collection . forEach ( value => {
371
- if ( this . gridAPI . grid . isRecordPinned ( value ) ) {
372
- value = { recordData : value , ghostRec : true } ;
369
+ private designateDisabledRows ( collection : ITreeGridRecord [ ] ) {
370
+ collection . forEach ( record => {
371
+ if ( this . gridAPI . grid . isRecordPinned ( record . data ) ) {
372
+ record . data = { recordData : record . data , ghostRec : true } ;
373
+ }
374
+ if ( record . children && record . children . length > 0 ) {
375
+ this . designateDisabledRows ( record . children ) ;
373
376
}
374
- result . push ( value ) ;
375
377
} ) ;
376
-
377
- return result ;
378
378
}
379
379
}
0 commit comments