@@ -6,6 +6,8 @@ import { IgxSummaryResult } from './summaries/grid-summary';
66import { ITreeGridRecord } from './tree-grid/tree-grid.interfaces' ;
77import { mergeWith } from 'lodash-es' ;
88import { CellType , GridServiceType , GridType , IGridValidationState , RowType , ValidationStatus } from './common/grid.interface' ;
9+ import { IgxPivotGridComponent } from './pivot-grid/public_api' ;
10+ import { PivotUtil } from './pivot-grid/pivot-util' ;
911
1012abstract class BaseRow implements RowType {
1113 public index : number ;
@@ -800,10 +802,10 @@ export class IgxPivotGridRow implements RowType {
800802 /**
801803 * The grid that contains the row.
802804 */
803- public grid : GridType ;
805+ public grid : IgxPivotGridComponent ;
804806 private _data ?: any ;
805807
806- constructor ( grid : GridType , index : number , data ?: any ) {
808+ constructor ( grid : IgxPivotGridComponent , index : number , data ?: any ) {
807809 this . grid = grid ;
808810 this . index = index ;
809811 this . _data = data && data . addRow && data . recordRef ? data . recordRef : data ;
@@ -834,9 +836,9 @@ export class IgxPivotGridRow implements RowType {
834836 * ```
835837 */
836838 public get key ( ) : any {
837- const data = this . _data ?? this . grid . dataView [ this . index ] ;
838- const primaryKey = this . grid . primaryKey ;
839- return primaryKey ? data [ primaryKey ] : data ;
839+ const dimension = this . grid . visibleRowDimensions [ this . grid . visibleRowDimensions . length - 1 ] ;
840+ const recordKey = PivotUtil . getRecordKey ( this . data , dimension ) ;
841+ return recordKey ? recordKey : null ;
840842 }
841843
842844 /**
0 commit comments