Sum specific table column #715
-
Is there a way to obtain the sum of the column values in the list operation within the header and footer of a table? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @eudovic thanks for the question. We don't have a built in way to do it. We discussed it a little bit here: Laravel-Backpack/CRUD#1441 One of the community members shared a little snippet he uses to add the sum of a column: https://gist.github.com/breizhwave/545a361ed941d7b449e7a9a07bf97055 To avoid overwriting the whole Hope that helps. Cheers |
Beta Was this translation helpful? Give feedback.
Hey @eudovic thanks for the question.
We don't have a built in way to do it. We discussed it a little bit here: Laravel-Backpack/CRUD#1441
One of the community members shared a little snippet he uses to add the sum of a column: https://gist.github.com/breizhwave/545a361ed941d7b449e7a9a07bf97055
To avoid overwriting the whole
list.blade.php
you can add in as a general script https://backpackforlaravel.com/docs/6.x/base-how-to#add-custom-javascript-to-all-admin-panel-pages, but only register it when an element with attributebp-section="crud-operation-list
exist on page.Alternatively you can add it as a widget directly on the operation: https://backpackforlaravel.com/docs/6.x/crud-how-to#h…