filamentgroup / tablesaw

A group of plugins for responsive tables.
MIT License
5.48k stars 434 forks source link

Angular 2 and rebuilt table #219

Closed ghost closed 7 years ago

ghost commented 8 years ago

Love the way your framework looks! I am building an Angular 2 app and have a component that encapsulates a table. After a user selects from a dropdown the table is rebuilt and columns get added or removed.

So far, I've tried:

$(this.elementRef.nativeElement).trigger("enhance.tablesaw");

and

$(this.elementRef.nativeElement).table().data("table").refresh();

and nether rebuild the MiniMap.

Any ideas?

btw: I'm using v2.0.3

jgibson commented 8 years ago

I solved the refresh problem by destroying the table and recreating it. I'd try:

$(this.elementRef.nativeElement).table().data("table").destroy()
$(this.elementRef.nativeElement).table()
zachleat commented 8 years ago

What table type is this?

zachleat commented 7 years ago

Please reopen if you need additional help.

juanjosesanchezesteban commented 7 years ago

Hi, I'm working with Angular 4 and Tablesaw v3.0.2

I initialize my table by calling $(document).trigger("enhance.tablesaw") but when I want to refresh it by calling $(this.elementRef.nativeElement).table().data("table").refresh() jQuery throws an exception telling me that $(...).table is not a function

Any ideas?