@@ -58,22 +58,22 @@ export class PivotRowDimensionsStrategy implements IPivotDimensionStrategy {
58
58
. processHierarchy ( hierarchyFields , newData [ i ] ?? [ ] , pivotKeys , 0 ) ;
59
59
PivotUtil . processSiblingProperties ( newData [ i ] , siblingData , pivotKeys ) ;
60
60
61
- PivotUtil . processSubGroups ( row , prevRowDims . slice ( 0 ) , siblingData , pivotKeys ) ;
62
- if ( siblingData . length > 1 ) {
63
- newData [ i ] [ row . memberName + '_' + pivotKeys . records ] = siblingData ;
64
- } else {
65
- newData . splice ( i , 1 , ...siblingData ) ;
66
- }
61
+ PivotUtil . processSubGroups ( row , prevRowDims . slice ( 0 ) , siblingData , pivotKeys ) ;
62
+ if ( PivotUtil . getDimensionDepth ( prevDim ) > PivotUtil . getDimensionDepth ( row ) && siblingData . length > 1 ) {
63
+ newData [ i ] [ row . memberName + '_' + pivotKeys . records ] = siblingData ;
64
+ } else {
65
+ newData . splice ( i , 1 , ...siblingData ) ;
67
66
i += siblingData . length - 1 ;
68
67
}
69
- data = newData ;
70
- prevDim = row ;
71
- prevRowDims . push ( row ) ;
72
68
}
69
+ data = newData ;
70
+ prevDim = row ;
71
+ prevRowDims . push ( row ) ;
73
72
}
74
- return data ;
75
73
}
74
+ return data ;
76
75
}
76
+ }
77
77
78
78
export class PivotColumnDimensionsStrategy implements IPivotDimensionStrategy {
79
79
private static _instance : PivotRowDimensionsStrategy = null ;
@@ -176,7 +176,7 @@ export class DimensionValuesFilteringStrategy extends FilteringStrategy {
176
176
}
177
177
178
178
protected getFieldValue ( rec : any , fieldName : string , isDate : boolean = false , isTime : boolean = false ,
179
- grid ?: PivotGridType ) : any {
179
+ grid ?: PivotGridType ) : any {
180
180
const config = grid . pivotConfiguration ;
181
181
const allDimensions = config . rows . concat ( config . columns ) . concat ( config . filters ) . filter ( x => x !== null ) ;
182
182
const enabledDimensions = allDimensions . filter ( x => x && x . enabled ) ;
@@ -192,13 +192,13 @@ export class DefaultPivotSortingStrategy extends DefaultSortingStrategy {
192
192
return this . _instance || ( this . _instance = new this ( ) ) ;
193
193
}
194
194
public sort ( data : any [ ] ,
195
- fieldName : string ,
196
- dir : SortingDirection ,
197
- ignoreCase : boolean ,
198
- valueResolver : ( obj : any , key : string , isDate ?: boolean ) => any ,
199
- isDate ?: boolean ,
200
- isTime ?: boolean ,
201
- grid ?: PivotGridType ) {
195
+ fieldName : string ,
196
+ dir : SortingDirection ,
197
+ ignoreCase : boolean ,
198
+ valueResolver : ( obj : any , key : string , isDate ?: boolean ) => any ,
199
+ isDate ?: boolean ,
200
+ isTime ?: boolean ,
201
+ grid ?: PivotGridType ) {
202
202
const key = fieldName ;
203
203
const config = grid . pivotConfiguration ;
204
204
const allDimensions = config . rows . concat ( config . columns ) . concat ( config . filters ) . filter ( x => x !== null ) ;
0 commit comments