ng2-smart-table icon indicating copy to clipboard operation
ng2-smart-table copied to clipboard

Add footer in ng2-smart table for sum purpose?

Open Hmdawood87 opened this issue 4 years ago • 3 comments

Can anyone help me to solve this problem

Hmdawood87 avatar Apr 15 '20 14:04 Hmdawood87

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 }

mohammad0omar avatar Jun 07 '20 12:06 mohammad0omar

I think we still need a footer.

hughnguyen9999 avatar Oct 31 '20 07:10 hughnguyen9999

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.

nikesh9220 avatar Oct 17 '21 10:10 nikesh9220