Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
151140 | Jan 31,2020 09:33 PM UTC | Mar 3,2020 06:21 AM UTC | Angular - EJ 2 | 3 |
![]() |
Tags: Grid |
App.component.ts
public onSelect(args: any): void {
if(args.item.text === 'Update'){
this.grid.endEdit();
}
if(args.item.text === 'Edit'){
this.grid.selectRow(0);
this.grid.startEdit();
}
if(args.item.text === 'Delete'){
this.grid.selectRow(0);
this.grid.deleteRow(this.grid.getContent().querySelectorAll('.e-row')[0] as any);
}
} |
App.component.html
<ng-template #toolbarTemplate let-data>
<button ejs-dropdownbutton [items]='items' (select)='onSelect($event)' content='Edit Options'></button>`
</ng-template> |
<ejs-grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'>
. . . .
</ejs-grid>
<ng-template #template let-data>
<ejs-checkbox label="Checkbox" [indeterminate]="true"></ejs-checkbox>
</ng-template>
|
@ViewChild('template')
public toolbarTemplate: any;
@ViewChild('template2')
public sliderTemplate: any;
public ngOnInit(): void {
this.data = orderDetails;
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog' };
this.toolbar = ['Add', 'Edit', 'Delete', ‘Search’, {template: this.toolbarTemplate}, {template: this.sliderTemplate}];
. . . . .
}
|
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.