File tree Expand file tree Collapse file tree 3 files changed +27
-15
lines changed
projects/igniteui-angular/src/lib/grids/tree-grid Expand file tree Collapse file tree 3 files changed +27
-15
lines changed Original file line number Diff line number Diff line change 80
80
| visibleColumns:hasVisibleColumns
81
81
| treeGridRowPinning:id:pipeTrigger
82
82
| treeGridFiltering:filteringExpressionsTree:filterStrategy:advancedFilteringExpressionsTree:id:pipeTrigger:filteringPipeTrigger:true
83
- | treeGridSorting:sortingExpressions:sortStrategy:id:pipeTrigger as pinnedData '>
83
+ | treeGridSorting:sortingExpressions:sortStrategy:id:pipeTrigger:true as pinnedData '>
84
84
< div #pinContainer *ngIf ='pinnedData.length > 0 '
85
85
[ngClass] ="{
86
86
'igx-grid__tr--pinned-bottom': !isRowPinningToTop,
Original file line number Diff line number Diff line change @@ -137,8 +137,8 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
137
137
*/
138
138
set filteredData ( value ) {
139
139
this . _filteredData = value ;
140
-
141
140
}
141
+
142
142
143
143
/**
144
144
* Get transactions service for the grid.
@@ -366,6 +366,28 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
366
366
super . ngAfterContentInit ( ) ;
367
367
}
368
368
369
+ /**
370
+ * @hidden @internal
371
+ */
372
+ public setFilteredSortedData ( data , pinned : boolean ) {
373
+ super . setFilteredSortedData ( data , pinned ) ;
374
+ const flatFilteredSortedData = [ ] ;
375
+ this . flattenTreeGridRecords ( this . filteredSortedData , flatFilteredSortedData ) ;
376
+ this . filteredSortedData = flatFilteredSortedData ;
377
+ }
378
+
379
+ /**
380
+ * @hidden @internal
381
+ */
382
+ private flattenTreeGridRecords ( records : ITreeGridRecord [ ] , flatData : any [ ] ) {
383
+ if ( records && records . length ) {
384
+ for ( const record of records ) {
385
+ flatData . push ( record . data ) ;
386
+ this . flattenTreeGridRecords ( record . children , flatData ) ;
387
+ }
388
+ }
389
+ }
390
+
369
391
private loadChildrenOnRowExpansion ( args : IRowToggleEventArgs ) {
370
392
if ( this . loadChildrenOnDemand ) {
371
393
const parentID = args . rowID ;
Original file line number Diff line number Diff line change @@ -202,7 +202,8 @@ export class IgxTreeGridSortingPipe implements PipeTransform {
202
202
expressions : ISortingExpression [ ] ,
203
203
sorting : IGridSortingStrategy ,
204
204
id : string ,
205
- pipeTrigger : number ) : ITreeGridRecord [ ] {
205
+ pipeTrigger : number ,
206
+ pinned ?: boolean ) : ITreeGridRecord [ ] {
206
207
const grid = this . gridAPI . grid ;
207
208
208
209
let result : ITreeGridRecord [ ] ;
@@ -211,21 +212,10 @@ export class IgxTreeGridSortingPipe implements PipeTransform {
211
212
} else {
212
213
result = DataUtil . treeGridSort ( hierarchicalData , expressions , sorting ) ;
213
214
}
214
- const filteredSortedData = [ ] ;
215
- this . flattenTreeGridRecords ( result , filteredSortedData ) ;
216
- grid . filteredSortedData = filteredSortedData ;
215
+ grid . setFilteredSortedData ( result , pinned ) ;
217
216
218
217
return result ;
219
218
}
220
-
221
- private flattenTreeGridRecords ( records : ITreeGridRecord [ ] , flatData : any [ ] ) {
222
- if ( records && records . length ) {
223
- for ( const record of records ) {
224
- flatData . push ( record . data ) ;
225
- this . flattenTreeGridRecords ( record . children , flatData ) ;
226
- }
227
- }
228
- }
229
219
}
230
220
231
221
/** @hidden */
You can’t perform that action at this time.
0 commit comments