|
|
|
public onRemove(args) {
if (confirm("Would you like to remove this item")) {
args.cancel = false;
} else {
args.cancel = true;
}
} |
|
public onRemove(args) {
args.cancel = true;
this.currentValue = args.itemData.Id;
this.DialogObj = DialogUtility.confirm({
title: " Confirmation Dialog",
content: "Would you like remove this item!",
okButton: { text: "Yes", click: this.okClick.bind(this) },
cancelButton: { text: "No", click: this.cancelClick.bind(this) },
showCloseIcon: true,
closeOnEscape: true,
animationSettings: { effect: "Zoom" }
});
}
private okClick(): void {
var value = this.multiselectobj.value;
var index = value.indexOf(this.currentValue as never);
if (index > -1) {
value.splice(index, 1);
this.multiselectobj.value = JSON.parse(JSON.stringify(value));
}
this.DialogObj.hide();
}
private cancelClick(): void {
this.DialogObj.hide();
}
|