I think it is because you are using [dtTrigger]="dtTrigger"
in Angular DataTables and rerendering the table on the same page. If you have this problem you should use the following trick to handle dtTrigger
<table datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="table">
Make sure you do not use this.dtTrigger.next()
on ngOnInit()
ngAfterViewInit(): void {
this.dtTrigger.next();
}
Rerender it when you use the second time
rerender(): void {
this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
dtInstance.destroy();
this.dtTrigger.next();
});
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…