11import { DeprecateProperty } from '../core/deprecateDecorators' ;
22import { IGroupByRecord } from '../data-operations/groupby-record.interface' ;
33import { IgxRow } from './common/crud.service' ;
4- import { FlatGridType , GridType , HierarchicalGridType , TreeGridType } from './common/grid.interface' ;
54import { RowType } from './common/row.interface' ;
6- import { IgxGridBaseDirective } from './grid-base.directive' ;
75import { IgxGridAPIService } from './grid/grid-api.service' ;
6+ import { IgxGridComponent } from './grid/grid.component' ;
7+ import { IgxHierarchicalGridComponent } from './hierarchical-grid/hierarchical-grid.component' ;
88import { IgxSummaryResult } from './summaries/grid-summary' ;
9+ import { IgxTreeGridComponent } from './tree-grid/tree-grid.component' ;
910import { ITreeGridRecord } from './tree-grid/tree-grid.interfaces' ;
1011
1112abstract 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