click(){
this.grid.columns = [ { field: 'OrderDate', headerText: 'Order Date', width: 130, format: 'yMd', textAlign: 'Right' },
{ field: 'Freight', width: 120, format: 'C2', textAlign: 'Right' },
{ field: 'ShippedDate', headerText: 'Shipped Date', width: 140, format: 'yMd', textAlign: 'Right' },
{ field: 'ShipCountry', headerText: 'Ship Country', width: 150 }];
}
|
How can i make the field to default one from HTML?
And, Can i put button click event on column components?
Please, Answer i need this!
export class AppComponent {
public data: Object[];
public initialPage: Object;
@ViewChild('grid',{static :false})
public grid:GridComponent;
ngOnInit(): void {
this.data = data;
this.initialPage = { pageSizes: true, pageCount: 4 };
}
click(){ //button click event
this.grid.columns = [ { field: 'OrderDate', headerText: 'Order Date', width: 130, format: 'yMd', textAlign: 'Right' },
{ field: 'Freight', customAttributes: { class: 'customcss' }, width: 120, format: 'C2', textAlign: 'Right' },
{ field: 'ShippedDate', headerText: 'Shipped Date', width: 140, format: 'yMd', textAlign: 'Right' },
{ field: 'ShipCountry', customAttributes: { class: 'customcss' }, headerText: 'Ship Country', width: 150 }];
}
}
|