Issue
I am implementing a dialog that will open a pop up asking if the user wanto to delete and imediatly the next step is ask for a comment.
For the first one (ask if want to delete), the code was good. I used the same method to implement this in cascade, but the files are not being deleted.
This is the code:
deleteRow(i: any) {
this.dialogService
.openConfigDialog('Are you really want to delete this file ?')
.afterClosed()
.subscribe(async (res) => {
if (res) {
/* this.reason
.openReasonDialog("Please describe the reason for delete")
.afterClosed()
.subscribe(async (res) => {
if (res) { */
let deleteRowRequest = {
IstValues: [this.dataSource.data[i]]
};
this.istManagementService.deleteRecord(this.inputTable, deleteRowRequest).subscribe(
(res: any) => {
this.dataSource.data.splice(i, 1);
this.dataSource._updateChangeSubscription();
}
)
/* }}) */
}
}
)
}
refresh(): void { window.location.reload()}
If I comment out, the files are deleted. If I do not comment, they are not deleted.
Solution
Hard to share all code because my dialogs are in a library and they are called by a service, but what I did to do a quick test it was this.
dialogNotify() {
let data2: IDialogNotify = {
title: 'Toolbar Menu',
warning: 'Toolbar Menu',
message1: 'The menu toolbar will show...',
message2: 'NOTICE - When making changes to blah blah.' +
' ... depending on the processing power of your device. Check the Messages indicator on the top right' +
' of the screen.',
confirmButton: 'Ok, I got it',
};
this.dialogService.openNotify(data2);
this.dialogService.openNotifyConfirmed().subscribe((confirmed: any) => {
if (confirmed) {
let data2: IDialogNotify = {
title: 'Toolbar Menu',
warning: 'Toolbar Menu',
message1: "error",
message2: "",
confirmButton: 'Ok, I got it',
};
this.dialogService.openNotify(data2);
this.dialogService.openNotifyConfirmed().subscribe((confirmed: any) => {
if (confirmed) {
this.logger.info('Confirmed: nested dialog');
}
});
}
});
}
Not sure if that helps you, but it did work. Are you sure that you are getting a true value for the 2nd one?
Answered By - Voltan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.