Component.ts
import { Component, OnInit,ViewChild } from '@angular/core';
import { orderData } from './data';
import { EditService, ToolbarService, PageService,GridComponent } from '@syncfusion/ej2-angular-grids';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
providers: [ToolbarService, EditService, PageService]
})
export class AppComponent {
public data: Object[];
public editSettings: Object;
public toolbar: string[],
public pageSettings: Object;
@ViewChild("Batchgrid1",{static:true})
public grid1:GridComponent;
@ViewChild("Batchgrid2",{static:true})
public grid2:GridComponent;
@ViewChild("Batchgrid3",{static:true})
public grid3:GridComponent;
public ngOnInit(): void {
this.data = orderData;
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Batch' };
this.toolbar = ['Add', 'Delete'];
this.pageSettings = {pageCount: 5};
}
public Save():void{
this.grid1.editModule.batchSave();
this.grid2.editModule.batchSave();
this.grid3.editModule.batchSave();
}
} |