Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144794 | May 23,2019 05:42 AM UTC | Jun 20,2019 01:39 PM UTC | Angular - EJ 2 | 5 |
![]() |
Tags: Grid |
<div class="control-section">
<button (click)='handleClick($event)'type='button'>DataUpdate</button>
<div *ngFor="let item of array">
<ejs-grid #grid [dataSource]='item.firstName'>
</ejs-grid>
</div>
</div>
|
export class AppComponent {
public data: Object[] = [];
@ViewChildren(GridComponent) grids !: QueryList<GridComponent>;
// define unique id to each object to define it to grid.
public array: [object] = [
{ firstName: orderDetails.slice(0,4) },
{ firstName: orderDetails.slice(5,10) },
{ firstName: customerData.slice(0,4) }
];
ngOnInit(): void {
}
handleClick(){
for(var i=0;i<this.array.length;i++){
this.array[i].firstName.push({ OrderID: 10252, CustomerName: "VINET", Freight: 55.55,CustomerID: "VINET",ContactName: "Sam", Country: "INDIA", Address: "Check" }); // updating the dataSorce
}
this.grids.forEach(div => div.refresh()); // refresh each grid
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.