<ejs-grid #Grid id='Grid' [dataSource]='parentData' [childGrid]='childGrid'>
<e-columns>
………………………………………….
</e-columns>
</ejs-grid>
……………………………………………
export class AppComponent {
@ViewChild('Grid')
public appGrid: GridComponent;
public parentData: Object[];
public childGrid: any;
public secondChildGrid: any;
ngOnInit(): void {
this.parentData = employeeData;
this.childGrid = {
dataSource: orderDatas,
queryString: 'EmployeeID',
allowPaging: true,
actionComplete: onComplete.bind(this),
editSettings: {allowEditing: true},
pageSettings: {pageSize: 6, pageCount: 5},
columns: [
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'ShipCity', headerText: 'Ship City', width: 120 },
{ field: 'Freight', headerText: 'Freight', width: 120 },
{ field: 'ShipName', headerText: 'Ship Name', width: 150 }
]
};
}
}
function onComplete(args){
let proxy = this // this reutns appcomponent instance
this.appGrid; //here you can get the parent Grid instance.
}
|