ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
393 stars 48 forks source link

data grid footer template issue #15

Closed panakour closed 3 years ago

panakour commented 4 years ago

The summary is not working in data grid if the data is coming from a service after ngOnInit is executed. Because of the condition this.data?.length > 0 && !this.loading https://github.com/ng-matero/extensions/blob/65979c57e62c6a0412618d2a4a86ddfa105c2921/projects/extensions/data-grid/grid.component.ts#L157

Is there any reason for this conditions? I think this.showSummary is enough

Thanks.

nzbin commented 3 years ago

I will try it, thanks for your advice.

nzbin commented 3 years ago

Can you give me a demo online?

panakour commented 3 years ago

I cant because its an authenticated admin panel with a client's data. But I think if you try within component ngOnInit you will have the same issue: you have the data in component like so: data: TeamIncomeItem[];

and in ngOnInit

this.apiService.get().subscribe((response: any) => {
    this.isLoading = false;
    this.data = response;
});
nzbin commented 3 years ago

I have modified conditions to fix this issue, the reason is that foot row won't be updated with data changes.

panakour commented 3 years ago

Now its ok. Thanks!