@@ -1839,6 +1839,15 @@ export abstract class IgxGridBaseDirective implements GridType,
1839
1839
@HostBinding ( 'class.igx-grid' )
1840
1840
protected baseClass = 'igx-grid' ;
1841
1841
1842
+ @HostBinding ( 'attr.aria-colcount' )
1843
+ protected get ariaColCount ( ) : number {
1844
+ return this . visibleColumns . length ;
1845
+ }
1846
+
1847
+ @HostBinding ( 'attr.aria-rowcount' )
1848
+ protected get ariaRowCount ( ) : number {
1849
+ return this . _rendered ? this . _rowCount : null ;
1850
+ }
1842
1851
1843
1852
/**
1844
1853
* Gets/Sets the resource strings.
@@ -3299,6 +3308,7 @@ export abstract class IgxGridBaseDirective implements GridType,
3299
3308
private _sortDescendingHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
3300
3309
private _gridSize : Size = Size . Large ;
3301
3310
private _defaultRowHeight = 50 ;
3311
+ private _rowCount : number ;
3302
3312
3303
3313
/**
3304
3314
* @hidden @internal
@@ -4120,6 +4130,7 @@ export abstract class IgxGridBaseDirective implements GridType,
4120
4130
if ( this . hasColumnsToAutosize ) {
4121
4131
this . autoSizeColumnsInView ( ) ;
4122
4132
}
4133
+ this . _calculateRowCount ( ) ;
4123
4134
this . _rendered = true ;
4124
4135
} ) ;
4125
4136
Promise . resolve ( ) . then ( ( ) => this . rendered . next ( true ) ) ;
@@ -6762,6 +6773,7 @@ export abstract class IgxGridBaseDirective implements GridType,
6762
6773
6763
6774
this . initColumns ( this . _columns , ( col : IgxColumnComponent ) => this . columnInit . emit ( col ) ) ;
6764
6775
this . columnListDiffer . diff ( this . columnList ) ;
6776
+ this . _calculateRowCount ( ) ;
6765
6777
6766
6778
this . columnList . changes
6767
6779
. pipe ( takeUntil ( this . destroy$ ) )
@@ -7985,4 +7997,15 @@ export abstract class IgxGridBaseDirective implements GridType,
7985
7997
return recreateTreeFromFields ( value , this . _columns ) as IFilteringExpressionsTree ;
7986
7998
}
7987
7999
}
8000
+
8001
+ private _calculateRowCount ( ) : void {
8002
+ if ( this . verticalScrollContainer ?. isRemote ) {
8003
+ this . _rowCount = this . verticalScrollContainer . totalItemCount ?? 0 ;
8004
+ } else if ( this . paginator ) {
8005
+ this . _rowCount = this . totalRecords ?? 0 ;
8006
+ } else {
8007
+ this . _rowCount = this . verticalScrollContainer ?. igxForOf ?. length ?? 0 ;
8008
+ }
8009
+ this . _rowCount += 1 ; // include header row
8010
+ }
7988
8011
}
0 commit comments