Skip to content

Commit c22157e

Browse files
committed
chore(*): resolving an issue in the API from leftover code.
1 parent 35470ac commit c22157e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

projects/igniteui-angular/src/lib/grids/api.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ export class GridBaseAPIService<T extends IgxGridBaseDirective & GridType> {
104104
*/
105105
public get_rec_id_by_index(index: number, dataCollection?: any[]): any {
106106
dataCollection = dataCollection || this.grid.data;
107-
if (index >= 0 && index < this.grid.dataView.length) {
108-
const rec = this.grid.dataView[index];
109-
return this.grid.primaryKey ? rec.data[this.grid.primaryKey] : rec.data;
107+
if (index >= 0 && index < dataCollection.length) {
108+
const rec = dataCollection[index];
109+
return this.grid.primaryKey ? rec[this.grid.primaryKey] : rec;
110110
}
111111
return null;
112112
}
@@ -416,7 +416,7 @@ export class GridBaseAPIService<T extends IgxGridBaseDirective & GridType> {
416416
*/
417417
public get_rec_index_by_id(pk: string | number, dataCollection?: any[]): number {
418418
dataCollection = dataCollection || this.grid.data;
419-
return this.grid.primaryKey ? this.grid.dataView.findIndex(rec => rec[this.grid.primaryKey] === pk) : -1;
419+
return this.grid.primaryKey ? dataCollection.findIndex(rec => rec[this.grid.primaryKey] === pk) : -1;
420420
}
421421

422422
public allow_expansion_state_change(rowID, expanded) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ export class IgxTreeGridAPIService extends GridBaseAPIService<IgxTreeGridCompone
177177
*/
178178
public get_rec_id_by_index(index: number, dataCollection?: any[]): any {
179179
dataCollection = dataCollection || this.grid.data;
180-
if (index >= 0 && index < this.grid.dataView.length) {
181-
const rec = this.grid.dataView[index];
180+
if (index >= 0 && index < dataCollection.length) {
181+
const rec = dataCollection[index];
182182
return this.grid.primaryKey ? rec.data[this.grid.primaryKey] : rec.data;
183183
}
184184
return null;
@@ -192,7 +192,7 @@ export class IgxTreeGridAPIService extends GridBaseAPIService<IgxTreeGridCompone
192192
*/
193193
public get_rec_index_by_id(pk: string | number, dataCollection?: any[]): number {
194194
dataCollection = dataCollection || this.grid.data;
195-
return this.grid.primaryKey ? this.grid.dataView.findIndex(rec => rec.data[this.grid.primaryKey] === pk) : -1;
195+
return this.grid.primaryKey ? dataCollection.findIndex(rec => rec.data[this.grid.primaryKey] === pk) : -1;
196196
}
197197

198198
public addRowToData(data: any, parentRowID?: any) {

0 commit comments

Comments
 (0)