The CRUD element uses Grid for its basic display, calling addTotals on that display works when displaying the data but crashes the edit portion.
$finances = $grant->ref('Finances');
$crud=$tabs->addTab('Finances')->add('CRUD', array('allow_add'=>false, 'allow_del'=>false));
$crud->grid->addTotals(array('requested', 'committed', 'spent'));
This adds the total row but caused the popup displayed by the edit button to have nothing inside - just a blank white popup. Anyway to get totals without "crashing" the CRUD Grid?
Thanks Roman, but I'm not a hundred percent as to why the if check is needed first.
Because this same page will render also when you see Form of the CRUD and not Grid.
That's quite standard approach of ATK4.