akveo / ng2-smart-table

Angular Smart Data Table component
https://akveo.github.io/ng2-smart-table/
MIT License
1.63k stars 877 forks source link

Add footer in ng2-smart table for sum purpose? #1154

Open Hmdawood87 opened 4 years ago

Hmdawood87 commented 4 years ago

Can anyone help me to solve this problem

mohammad0omar commented 4 years ago

maybe you can append a row to the table

get the element by id <ng2-samrt-table #table> use view child to get the native element of the table then search

this should be something like this:

this not the exact code - consider this as pseudo code

@ViewChild('table', { static: false }) table: TableComponent; AfterViewInit(){ let tableEl = this.table.nativeElement; let tbody = table.getElementsByTagName('tbody') or use querySelector; then append a tr child to tbody }

hughnguyen9999 commented 4 years ago

I think we still need a footer.

nikesh9220 commented 3 years ago

Appending the row would be a good idea but it will not great if we want to use sorting as if the user will sort the column then the last column (footer) will be also sorted.