ng2-smart-table
ng2-smart-table copied to clipboard
Add footer in ng2-smart table for sum purpose?
Can anyone help me to solve this problem
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 }
I think we still need a footer.
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.