Reena Lakra

Reena Lakra

  • NA
  • 146
  • 56k

List not refresh after close modal popup?

May 1 2018 7:36 AM
How can refresh a list after a close modal popup in angular?
 
I am using a list, where the edit button is present, on that button, I passed data to modal popup, update it and close the modal popup, but the list cannot be refresh.
 
The code on list component is : 
  1. openStudentDialog(rowData: any, statusValue: any): void {  
  2.         this.rowRecordId = rowData.recordId;  
  3.         this.statusValue = statusValue;  
  4.         let dialogRef = this.dialog.open(StudentUpdateDialog, {  
  5.             width: '250px',  
  6.             data: { recordId: this.rowRecordId, statusValue: statusValue}   
  7.         });  
  8.         this.getStudentList()      //i am using this but it cannot update the list  
  9.     }  
On Dialog Component code is :- 
  1. @Component({  
  2.     selector: 'student-update-dialog',  
  3.     templateUrl: 'student-update-dialog.html',  
  4.     providers: []  
  5. })  
  6. export class StudentUpdateDialog {  
  7.     rowData: any = "";  
  8.     status: any;  
  9.      
  10.     constructor(public dialogRef: MatDialogRef<StudentUpdateDialog >,  
  11.         @Inject(MAT_DIALOG_DATA) public data: any) {  
  12.         this.rowData = data;  
  13.         this.status = this.rowData.statusValue;  
  14.     }  
  15.   
  16.     onNoClick(): void {  
  17.          this.dialogRef.close();  
  18.      }  
  19.     SuccessUpdate(data: any) {  
  20.     }    
  21. }  
 

Answers (2)