@@ -7,7 +7,7 @@ import { GridType } from './grid.interface';
77import { IgxColumnComponent } from '../columns/column.component' ;
88import { ColumnDisplayOrder } from './enums' ;
99import { IgxColumnActionsComponent } from '../column-actions/column-actions.component' ;
10- import { IgxSummaryOperand , IgxSummaryResult } from '../grid/public_api' ;
10+ import { IgxGridRow , IgxSummaryOperand , IgxSummaryResult } from '../grid/public_api' ;
1111
1212/**
1313 * @hidden
@@ -71,17 +71,17 @@ export class IgxGridCellStylesPipe implements PipeTransform {
7171 name : 'igxGridRowClasses'
7272} )
7373export class IgxGridRowClassesPipe implements PipeTransform {
74- constructor ( private gridAPI : GridBaseAPIService < IgxGridBaseDirective & GridType > ) { }
7574
76- public transform ( cssClasses : { [ prop : string ] : any } , index : any , __ : number ) : string {
75+ constructor ( private gridAPI : GridBaseAPIService < IgxGridBaseDirective & GridType > ) { }
76+
77+ public transform ( cssClasses : { [ prop : string ] : any } , rowData : any , index : number , __ : number ) : string {
7778 if ( ! cssClasses ) {
7879 return '' ;
7980 }
8081 const result = [ ] ;
8182 for ( const cssClass of Object . keys ( cssClasses ) ) {
8283 const callbackOrValue = cssClasses [ cssClass ] ;
83- const grid = ( this . gridAPI . grid as any ) ;
84- const row = grid . getRowByIndex ( index ) ;
84+ const row = new IgxGridRow ( ( this . gridAPI . grid as any ) , index , rowData ) ;
8585 const apply = typeof callbackOrValue === 'function' ? callbackOrValue ( row ) : callbackOrValue ;
8686 if ( apply ) {
8787 result . push ( cssClass ) ;
@@ -102,15 +102,14 @@ export class IgxGridRowStylesPipe implements PipeTransform {
102102
103103 constructor ( private gridAPI : GridBaseAPIService < IgxGridBaseDirective & GridType > ) { }
104104
105- public transform ( styles : { [ prop : string ] : any } , index : number , __ : number ) : { [ prop : string ] : any } {
105+ public transform ( styles : { [ prop : string ] : any } , rowData : any , index : number , __ : number ) : { [ prop : string ] : any } {
106106 const css = { } ;
107107 if ( ! styles ) {
108108 return css ;
109109 }
110- const grid = ( this . gridAPI . grid as any ) ;
111110 for ( const prop of Object . keys ( styles ) ) {
112111 const cb = styles [ prop ] ;
113- const row = grid . getRowByIndex ( index ) ;
112+ const row = new IgxGridRow ( ( this . gridAPI . grid as any ) , index , rowData ) ;
114113 css [ prop ] = typeof cb === 'function' ? cb ( row ) : cb ;
115114 }
116115 return css ;
0 commit comments