ssuperczynski / ngx-easy-table

The Easiest Angular Table. 12kb gzipped! Tree-shakeable. 55 features and growing!
https://ngx-easy-table.eu
MIT License
371 stars 100 forks source link

Table not updating when in dynamic loaded component #387

Closed anuj509 closed 1 year ago

anuj509 commented 2 years ago

Hi, I have a dynamic loaded component which contains table. when I update the data, table is not updating. Kindly suggest some fix.

anuj509 commented 2 years ago

also sometimes when we update the data variable it does not reflect in table.

MatheusOliveira-dev commented 1 year ago

Have you tried something like: this.data = [... this.data]?

anuj509 commented 1 year ago

Have you tried something like: this.data = [... this.data]?

Yes I have tried this way as well

ssuperczynski commented 1 year ago

@anuj509 Without an example I can't help much, but I found one issue. When you use ngIf:

<ngx-table [configuration]="configuration" #table [data]="data" [columns]="columns" *ngIf="something"></ngx-table>

Please try to set static to false:

@ViewChild('table', { static: false }) table: APIDefinition;

I've fixed demo page, because it was causing an error indeed.

If this is not a fix for you, please create a new issue with some code. I'll help.