1- import { Component , TemplateRef , ViewChild , Input , AfterViewInit , ChangeDetectorRef } from '@angular/core' ;
1+ import { Component , TemplateRef , ViewChild , Input , AfterViewInit , ChangeDetectorRef , OnInit } from '@angular/core' ;
22import { IgxGridCellComponent } from '../grids/cell.component' ;
33import { IgxDateSummaryOperand , IgxNumberSummaryOperand , IgxSummaryResult } from '../grids/summaries/grid-summary' ;
44import { IGridCellEventArgs , IGridEditEventArgs , IgxGridTransaction } from '../grids/grid-base.component' ;
@@ -11,6 +11,7 @@ import { IgxColumnComponent } from '../grids/column.component';
1111import { IgxTransactionService } from '../services' ;
1212import { IgxFilteringOperand } from '../data-operations/filtering-condition' ;
1313import { ExpressionUI } from '../grids/filtering/grid-filtering.service' ;
14+ import { IgxGridComponent } from '../grids/grid' ;
1415
1516@Component ( {
1617 template : `<div style="width: 800px; height: 600px;">
@@ -1119,3 +1120,23 @@ export class DynamicColumnsComponent extends GridWithSizeComponent {
11191120 width = '800px' ;
11201121 height = '800px' ;
11211122}
1123+
1124+ @Component ( {
1125+ template : GridTemplateStrings . declareGrid (
1126+ ` [width]="width" [height]="height" [paging]="'true'" [perPage]="perPage" [primaryKey]="'ProductID'"` ,
1127+ '' , ColumnDefinitions . productBasicNumberID )
1128+ } )
1129+ export class GridWithUndefinedDataComponent implements OnInit {
1130+ @ViewChild ( IgxGridComponent , { static : true } )
1131+ public grid : IgxGridComponent ;
1132+ public data ;
1133+ public perPage = 5 ;
1134+ public width = '800px' ;
1135+ public height = '600px' ;
1136+
1137+ public ngOnInit ( ) : void {
1138+ setTimeout ( ( ) => {
1139+ this . data = SampleTestData . foodProductDataExtended ( ) ;
1140+ } , 300 ) ;
1141+ }
1142+ }
0 commit comments