|
<ejs-grid #grid id='Normalgrid' (recordClick)="recordClick($event)" (actionBegin)="actionBegin($event)"
(toolbarClick)="toolbarClick($event)" . . . . . . . . . . . . >
. . . . . . . .
</ejs-grid>
<ejs-dialog #Dialog content='Do you want to save your changes?' [buttons]='buttons' width='250px'
[visible]='hidden'> </ejs-dialog> |
|
public buttons: Object = [
{
click: args => {
this.flag = false;
this.Dialog.hide();
this.gridObj.endEdit();
},
buttonModel: {
content: "OK",
isPrimary: true
}
},
{
click: args => {
this.flag = false;
this.Dialog.hide();
this.gridObj.closeEdit();
},
buttonModel: {
content: "NO"
}
}
];
. . . . .
toolbarClick(args: any) {
if (args.item.text === "Update") {
args.cancel = true;
this.Dialog.show();
this.Dialog.isModal = true;
}
}
recordClick(args) {
if (this.gridObj.isEdit) {
this.flag = true;
}
}
actionBegin(args) {
if (args.requestType === "save" && this.flag) {
args.cancel = true;
this.Dialog.show();
this.Dialog.isModal = true;
}
}
}
|