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:
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.
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: