Skip to content

Commit 86bbf54

Browse files
committed
chore(*): remove virtualizationState check
1 parent de2f318 commit 86bbf54

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

projects/igniteui-angular/src/lib/grids/grid-navigation.service.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,12 @@ export class IgxGridNavigationService {
249249

250250
public isDataRow(rowIndex: number, includeSummary = false) {
251251
let curRow: any;
252-
if (this.grid.virtualizationState) {
253-
curRow = this.grid.dataView[rowIndex - this.grid.virtualizationState.startIndex];
254-
}else if (rowIndex < 0 || rowIndex > this.grid.dataView.length - 1) {
255-
return false;
252+
253+
if (rowIndex < 0 || rowIndex > this.grid.dataView.length - 1) {
254+
curRow = this.grid.dataView[rowIndex - this.grid.virtualizationState.startIndex];
255+
if (!curRow){
256+
return false;
257+
}
256258
}else {
257259
curRow = this.grid.dataView[rowIndex];
258260
}

projects/igniteui-angular/src/lib/grids/grid/grid.component.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,10 +1029,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
10291029
* @param index
10301030
*/
10311031
public getRowByIndex(index: number): RowType {
1032-
if (this.gridAPI.grid.virtualizationState){
1033-
return this.createRow(index);
1034-
}
1035-
if (index < 0 || index >= this.dataView.length) {
1032+
if (index < 0) {
10361033
return undefined;
10371034
}
10381035
return this.createRow(index);
@@ -1145,9 +1142,10 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
11451142
let row: RowType;
11461143
let rec: any;
11471144

1148-
if (this.gridAPI.grid.virtualizationState) {
1149-
const virtIndex = index - this.gridAPI.grid.virtualizationState.startIndex;
1150-
rec = data ?? this.dataView[virtIndex];
1145+
if (index < 0 || index >= this.dataView.length) {
1146+
if (index >= this.dataView.length){
1147+
rec = data ?? this.gridAPI.get_row_by_index(index).rowData;
1148+
}
11511149
}else {
11521150
rec = data ?? this.dataView[index];
11531151
}

0 commit comments

Comments
 (0)