grido icon indicating copy to clipboard operation
grido copied to clipboard

Add a columns SUM feature

Open miler87 opened this issue 11 years ago • 5 comments

It would be great to add a columns SUM feature. It can be attached to the grid in the same way as filters are.

Just the last row of the grid would contain sums of the (numerical) columns, specified by user by ->addSum()

From my point of view the funcionality should be sum of the visible rows (when paginator is enabled) or all rows without paginator.

des

miler87 avatar Aug 17 '13 14:08 miler87

@miler87 have you implemented it yet?

Ciki avatar Jun 25 '14 10:06 Ciki

@o5 have you thought of that feature yet? can you point me where I could start off implementing it?

Ciki avatar Jun 26 '14 14:06 Ciki

nevermind, I implemented it by extending Columns\Number & adding property $calculateSum & checking for it trueness in Grid.latte template

Ciki avatar Jun 26 '14 22:06 Ciki

@Ciki cool idea but does it work with pagination? We're facing the same problem right now but in our case we're expecting quite large datasets so we need pagination and (efficiently) calculated sums at the same time.

tobice avatar Jun 27 '14 07:06 tobice

yes, the calculation is actually made in .latte as well if that flag is set. so whatever is rendered it calculated sum

Ciki avatar Jun 29 '14 20:06 Ciki