Welcome, Guest
Username: Password: Remember me

TOPIC: [HOW TO] Add sum function in Grid

Add sum function in Grid 14 Oct 2013 07:10 #11389

  • ewajoom
  • ewajoom's Avatar
  • Offline
  • Junior Member
  • Posts: 36
  • Thank you received: 2
  • Karma: 0
Hi,

I would like to add a sum in grid for several columns.
Is it possible without programming ?

Thanks
Regards,
The administrator has disabled public write access.

Add sum function in Grid 16 Oct 2013 15:00 #11399

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Without programming, no.
priority for this feature : low.


In your view, just enumerate all items in a foreach,
sum the values in a new var :
$this->myTotal += $item->myValue;

Then, echo($this->myTotal); where you want in the template
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: ewajoom

Add sum function in Grid 21 Oct 2013 13:37 #11426

  • ewajoom
  • ewajoom's Avatar
  • Offline
  • Junior Member
  • Posts: 36
  • Thank you received: 2
  • Karma: 0
Very simple, thanks !
The administrator has disabled public write access.
Time to create page: 0.113 seconds

Get Started