import { Component,ViewChild, OnInit} from '@angular/core';
import { orderDetails } from './data';
import { GroupService, SortService, GridComponent } from '@syncfusion/ej2-angular-grids';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent {
public data: Object[] = [];
public columns: Object[] = [];
public template: any;
@ViewChild('template2')
public template2: any;
@ViewChild('grid') public grid: GridComponent;
ngOnInit(): void {
this.columns = [];
this.data =[];
}
ngAfterViewInit(): void {
(this.grid.getColumns()[5].template as any) = this.template2;
}
refreshbtnclick(args){
debugger;
this.columns = [
{ headerName: "Talking Track", field: "TalkingTrack", index: 0, visibility: false },
{ headerName: "Open Items", field: "OpenItems", visibility: false, index: 1 },
{ headerName: "Collector Name", field: "CollectorName", visibility: false, index: 2 },
{ headerName: "Phone No", field: "PhoneNo", visibility: false, index: 3 },
{ headerName: "SSO#", field: "Ssoid", visibility: true, index: 4 },
{ headerName: "Name", field: "Name", visibility: true, index: 5 },
{ headerName: "Customer #", field: "CustomerNo", visibility: true, index: 6 }]
this.data = [{
Address: "11 BD ANATOLE FRANCE,AUBERVILLIERS FRANCE 93300,,FR",
Balance: "0.00",
BillingCurrency: "EUR",
BusinessAlias: "495014",
CCNumber: "CH41",
CaseId: "Check LaSCA",
City: "AUBERVILLIERS",
CollectorName: "BATHILY, SAMBA",
CustomerNo: "0002345609",
Definer: "",
ExtendedName: "",
IsSensitiveCustomer: "",
Name: "SOC D IMAGERIE MEDICALE D AUBERV",
NativeAddress: "",
OpenItems: "0",
OrgId: "88",
PLName: "HEALTHCARE DI FR - CUSTOMER CREATION",
ParentSub: " ",
PhoneNo: " FX:",
Ssoid: "000000000",
Status1: "In-Active",
}, {
Address: "6029 - 3RD STREET S.E.,CALGARY ALBERTA T2H 1K3,,CA",
Balance: "0.00",
BillingCurrency: "CAD",
BusinessAlias: "0001ZTTsMAAX",
CCNumber: "CNWW",
CaseId: "Check LaSCA",
City: "CALGARY",
CollectorName: "CHANDRAN, BINA",
CustomerNo: "0002345639",
Definer: "",
ExtendedName: "",
IsSensitiveCustomer: "",
Name: "VECTOR ELECTRIC AND CONTROLS",
NativeAddress: "6029 - 3RD STREET S.E.,,,,,CA,AB,CALGARY,T2H 1K3",
OpenItems: "0",
OrgId: "",
PLName: "DI-DG19-NAM-JAX-CAD",
ParentSub: " ",
PhoneNo: "+1 905 858 6722 FX:",
Ssoid: "000000000",
Status1: "In-Active"
}
];
this.grid.refresh();
}
}