• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

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