File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
projects/igniteui-angular/src/lib/grids Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments