How to programmatically trigger refresh primeNG datatable when a button is clicked

前端 未结 3 1200
情歌与酒
情歌与酒 2021-01-12 00:54

I have a refresh button that is outside the primeNG datatable. How do I programmatically trigger to refresh the datatable?

something like this:



        
3条回答
  •  猫巷女王i
    2021-01-12 01:03

    The Angular form guide contains a small trick that could be used as a workaround, it consists on recreating the dom by adding *ngIf to the element to control its visibility

    visible: boolean = true;
    updateVisibility(): void {
      this.visible = false;
      setTimeout(() => this.visible = true, 0);
    }
    
    

提交回复
热议问题