• Fabrik4.5.1 for Joomla5.2.4

    Fabrik4.5.1 is out. This update is needed for J!5.2.4

    See Announcements

Solved Sum of values from repeat group in detail view

Trembowiecki

Active Member
Hi,

I use calc element (with AJAX! - it's fundamental in my case) for years now, including summing values from repeat groups. However now I have to show form with such a calc in detail view and... it just doesn't work. Form view = it's working, detail view = nope.

My code:
PHP:
$overall = ($data['repeat_table___element'] != NULL) ? array_sum($data['repeat_table___element']) : 0;

Which makes sense, as in detail view $data doesn't include this array. Is there another way of calculating repeated groups so it doesn't go south in detail view? Or maybe desabling re-calculating the calc value just in detail view, so it uses value from database?

UPDATE: Setting Calc on load = No and Calc on repeat = Yes did the trick.
 
Last edited:
thank you. this work perfectly. I have a line amount in repeat group then i need to sum all of those line amount in another calc out of repeat group. your code work like magic.
 
Back
Top