There is no built-in functionality for that. However, the grid is an HTML
helper object, so you can use server-side DOM manipulation to add a row at
the bottom of the table:
grid = SQLFORM.grid(db.mytable)
grid.element('.web2py_htmltable tbody').append(TR(total1, total2, total3,
...))
You'll need to add some logic to skip the above when the grid is generating
a create/update form, and if the grid records are paginated, you might only
want the totals on the last page.
Anthony
On Wednesday, May 20, 2015 at 1:38:50 AM UTC-4, Alen Cerovic wrote:
>
> Hi,
>
> how to add field totals in grid (or smartgrid) footer, for example sum
> numeric field in footer?
>
> Thank You
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.