@@ -25,6 +25,7 @@ export class IgxPivotRowPipe implements PipeTransform {
2525 config : IPivotConfiguration ,
2626 _ : Map < any , boolean > ,
2727 _pipeTrigger ?: number ,
28+ __ ?,
2829 pivotKeys : IPivotKeys = { aggregations : 'aggregations' , records : 'records' , children : 'children' , level : 'level' }
2930 ) : any [ ] {
3031 const enabledRows = config . rows . filter ( x => x . enabled ) ;
@@ -49,6 +50,7 @@ export class IgxPivotRowExpansionPipe implements PipeTransform {
4950 config : IPivotConfiguration ,
5051 expansionStates : Map < any , boolean > ,
5152 _pipeTrigger ?: number ,
53+ __ ?,
5254 pivotKeys : IPivotKeys = { aggregations : 'aggregations' , records : 'records' , children : 'children' , level : 'level' }
5355 ) : any [ ] {
5456 const enabledRows = config . rows . filter ( x => x . enabled ) ;
@@ -61,8 +63,21 @@ export class IgxPivotRowExpansionPipe implements PipeTransform {
6163 PivotUtil . flattenHierarchy ( data , config , row , expansionStates , pivotKeys , totalLlv , prevDims , 0 ) ;
6264 prevDims . push ( row ) ;
6365 }
66+ this . cleanState ( data , pivotKeys ) ;
6467 return data ;
6568 }
69+
70+ private cleanState ( data , pivotKeys ) {
71+ data . forEach ( rec => {
72+ const keys = Object . keys ( rec ) ;
73+ //remove all record keys from final data since we don't need them anymore.
74+ keys . forEach ( k => {
75+ if ( k . indexOf ( pivotKeys . records ) !== - 1 ) {
76+ delete rec [ k ] ;
77+ }
78+ } ) ;
79+ } ) ;
80+ }
6681}
6782
6883
@@ -80,6 +95,7 @@ export class IgxPivotColumnPipe implements PipeTransform {
8095 config : IPivotConfiguration ,
8196 _ : Map < any , boolean > ,
8297 _pipeTrigger ?: number ,
98+ __ ?,
8399 pivotKeys : IPivotKeys = { aggregations : 'aggregations' , records : 'records' , children : 'children' , level : 'level' }
84100 ) : any [ ] {
85101 const enabledColumns = config . columns . filter ( x => x . enabled ) ;
@@ -140,16 +156,15 @@ export class IgxPivotGridFilterPipe implements PipeTransform {
140156} )
141157export class IgxPivotGridSortingPipe implements PipeTransform {
142158
143- public transform ( collection : any [ ] , expressions : ISortingExpression [ ] , sorting : IGridSortingStrategy ,
144- id : string , pipeTrigger : number , pinned ?) : any [ ] {
159+ public transform ( collection : any [ ] , expressions : ISortingExpression [ ] , sorting : IGridSortingStrategy , pipeTrigger : number ) : any [ ] {
145160 let result : any [ ] ;
146161
147162 if ( ! expressions . length ) {
148163 result = collection ;
149164 } else {
165+ // TODO - sort recursively in all records collections.
150166 result = DataUtil . sort ( cloneArray ( collection ) , expressions , sorting ) ;
151167 }
152-
153168 return result ;
154169 }
155- }
170+ }
0 commit comments