Skip to content

Commit 0d00f9b

Browse files
authored
Merge branch 'master' into dTsvetkov/fix-9348-master
2 parents 428ba20 + 8433d02 commit 0d00f9b

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

projects/igniteui-angular/src/lib/grids/common/row.interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { IGroupByRecord } from '../../data-operations/groupby-record.interface';
22
import { IgxSummaryResult } from '../summaries/grid-summary';
33
import { ITreeGridRecord } from '../tree-grid/tree-grid.interfaces';
4+
import { GridType } from './grid.interface';
5+
46
export interface RowType {
57
index: number;
68
viewIndex?: number;
@@ -23,6 +25,7 @@ export interface RowType {
2325
children?: ITreeGridRecord[];
2426
parent?: ITreeGridRecord;
2527
hasChildren?: boolean;
28+
grid: GridType;
2629
update?: (value: any) => void;
2730
delete?: () => any;
2831
pin?: () => void;

projects/igniteui-angular/src/lib/grids/grid-public-row.ts

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import { DeprecateProperty } from '../core/deprecateDecorators';
22
import { IGroupByRecord } from '../data-operations/groupby-record.interface';
33
import { IgxRow } from './common/crud.service';
4-
import { FlatGridType, GridType, HierarchicalGridType, TreeGridType } from './common/grid.interface';
54
import { RowType } from './common/row.interface';
6-
import { IgxGridBaseDirective } from './grid-base.directive';
75
import { IgxGridAPIService } from './grid/grid-api.service';
6+
import { IgxGridComponent } from './grid/grid.component';
7+
import { IgxHierarchicalGridComponent } from './hierarchical-grid/hierarchical-grid.component';
88
import { IgxSummaryResult } from './summaries/grid-summary';
9+
import { IgxTreeGridComponent } from './tree-grid/tree-grid.component';
910
import { ITreeGridRecord } from './tree-grid/tree-grid.interfaces';
1011

1112
abstract class BaseRow implements RowType {
1213
public index: number;
13-
protected grid: IgxGridBaseDirective & FlatGridType |
14-
IgxGridBaseDirective & TreeGridType |
15-
IgxGridBaseDirective & HierarchicalGridType;
14+
/**
15+
* The grid that contains the row.
16+
*/
17+
public grid: IgxGridComponent | IgxTreeGridComponent | IgxHierarchicalGridComponent;
1618
protected _data?: any;
1719

1820
/**
@@ -253,7 +255,7 @@ export class IgxGridRow extends BaseRow implements RowType {
253255
/**
254256
* @hidden
255257
*/
256-
constructor(protected grid: IgxGridBaseDirective & FlatGridType,
258+
constructor(public grid: IgxGridComponent,
257259
public index: number, protected _data?: any) {
258260
super();
259261
}
@@ -273,7 +275,7 @@ export class IgxTreeGridRow extends BaseRow implements RowType {
273275
/**
274276
* @hidden
275277
*/
276-
constructor(protected grid: IgxGridBaseDirective & TreeGridType,
278+
constructor(public grid: IgxTreeGridComponent,
277279
public index: number, protected _data?: any, private _treeRow?: ITreeGridRecord) {
278280
super();
279281
}
@@ -390,7 +392,7 @@ export class IgxHierarchicalGridRow extends BaseRow implements RowType {
390392
/**
391393
* @hidden
392394
*/
393-
constructor(protected grid: IgxGridBaseDirective & HierarchicalGridType,
395+
constructor(public grid: IgxHierarchicalGridComponent,
394396
public index: number, protected _data?: any) {
395397
super();
396398
}
@@ -409,6 +411,11 @@ export class IgxGroupByRow implements RowType {
409411
*/
410412
public index: number;
411413

414+
/**
415+
* The grid that contains the row.
416+
*/
417+
public grid: IgxGridComponent;
418+
412419
/**
413420
* Returns always true, because this is in instance of an IgxGroupByRow.
414421
*/
@@ -424,7 +431,8 @@ export class IgxGroupByRow implements RowType {
424431
/**
425432
* @hidden
426433
*/
427-
constructor(private _grid: IgxGridBaseDirective & FlatGridType, index: number, private _groupRow?: IGroupByRecord) {
434+
constructor(grid: IgxGridComponent, index: number, private _groupRow?: IGroupByRecord) {
435+
this.grid = grid;
428436
this.index = index;
429437
this.isGroupByRow = true;
430438
}
@@ -457,13 +465,6 @@ export class IgxGroupByRow implements RowType {
457465
this.grid.toggleGroup(this.groupRow);
458466
}
459467

460-
/**
461-
* Get a reference to the grid that contains the GroupBy row.
462-
*/
463-
protected get grid(): IgxGridBaseDirective & FlatGridType {
464-
return this._grid;
465-
}
466-
467468
private get gridAPI(): IgxGridAPIService {
468469
return this.grid.gridAPI as IgxGridAPIService;
469470
}
@@ -475,6 +476,11 @@ export class IgxSummaryRow implements RowType {
475476
*/
476477
public index: number;
477478

479+
/**
480+
* The grid that contains the row.
481+
*/
482+
public grid: IgxGridComponent | IgxTreeGridComponent | IgxHierarchicalGridComponent;
483+
478484
/**
479485
* Returns always true, because this is in instance of an IgxGroupByRow.
480486
*/
@@ -490,15 +496,10 @@ export class IgxSummaryRow implements RowType {
490496
/**
491497
* @hidden
492498
*/
493-
constructor(protected _grid: IgxGridBaseDirective & GridType, index: number, private _summaries?: Map<string, IgxSummaryResult[]>) {
499+
constructor(grid: IgxGridComponent | IgxTreeGridComponent | IgxHierarchicalGridComponent,
500+
index: number, private _summaries?: Map<string, IgxSummaryResult[]>) {
501+
this.grid = grid;
494502
this.index = index;
495503
this.isSummaryRow = true;
496504
}
497-
498-
/**
499-
* Get a reference to the grid that contains the selected row.
500-
*/
501-
protected get grid(): IgxGridBaseDirective & GridType {
502-
return this._grid;
503-
}
504505
}

0 commit comments

Comments
 (0)