refresh array without page load

Published

I implemented a functionality in angular, Where i’m showing the filtered array details in grid.
on clicking a button in grid, i’m calling a function onAcceptClick() whre we can update the record.
When the record is updated, i need to refresh the filtered array, without reloading the page.
Help me achieve this functionality.

 selected:any;
  filtered : any=[];
  Form: FormGroup;

    onOptionsSelected() {
      if (this.Form.invalid) {
        alert('Please choose an option')
        return;        
      }
      else{
      this.filtered = this.studentInfo.filter(t=>t.Id == this.selected);
      }      
    }  

    public Response: any = [];

    onClick(index: number, id: string, roll_no: string){
      const obj = {
        id : id,
        roll_no : roll_no,
      }      
     this.Srvc.postmethod('students', obj).subscribe((response:any)=>{
        this.Response = response;
        if(this.Response.status === 200)
        {
          alert('Record updated');                  
        }  
   });
  }

Source: Angular Questions

Published
Categorized as angular, arrays, refresh Tagged , ,

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq