...
complete(args) {
if(args.requestType == 'delete'){
this.isDeleted = true;
}
}
selecting(args) {
if(this.isDeleted) {
args.cancel = true;
this.isDeleted = false;
}
}
... |
...
delete(args){
this.grid.selectionModule.clearRowSelection();
}
... |
<ejs-grid #normalgrid [dataSource]='data' [editSettings]='editSettings' [toolbar]='toolbar' (actionComplete)="onActionComplete($event)" (rowSelecting)='onRowSelectionDelete($event)'>
<e-columns>
. . .
</e-columns>
</ejs-grid> |
@Component({
selector: 'control-content',
templateUrl: 'normal-edit.html',
})
export class NormalEditComponent implements OnInit {
. . .
onActionComplete(event) {
if (event.requestType === 'delete') {
this.isDeleted = true;
}
}
onRowSelectionDelete(event: any) {
if (this.isDeleted) {
event.cancel = true;
this.isDeleted = false;
}
}
} |